Hi guys,
I am trying to send commands to a UNIX server using plink. I have found some documentation that shows me how to setup a command string. I have followed this and am now attempting to pass three commands to the UNIX server using plink. The issue is, I do not seem to be connecting to the server. Can anyone look at my code and see if I am doing something wrong?
I am trying to send commands to a UNIX server using plink. I have found some documentation that shows me how to setup a command string. I have followed this and am now attempting to pass three commands to the UNIX server using plink. The issue is, I do not seem to be connecting to the server. Can anyone look at my code and see if I am doing something wrong?
Code:
'Execute First Command
Dim a As New ProcessStartInfo(vbHide)
a.FileName = "\\testServ\AppFiles\plink.exe"
a.Arguments = "plink -ssh " & Server & " -l testUser -pw pass123 sudo /usr/sbin/userdbset -d -u " & frmPasswordResets.txtUsername.Text & " login_time"
a.WindowStyle = ProcessWindowStyle.Hidden
Process.Start(a)
'Execute Second Command
Dim b As New ProcessStartInfo(vbHide)
b.FileName = "\\testServ\AppFiles\plink.exe"
b.Arguments = "plink -ssh " & Server & " -l testUser -pw pass123 sudo /usr/sbin/usermod -p GWwrzWGMPgX3I " & frmPasswordResets.txtUsername.Text
b.WindowStyle = ProcessWindowStyle.Hidden
Process.Start(b)
'Execute Third Command
Dim c As New ProcessStartInfo(vbHide)
c.FileName = "\\testServ\AppFiles\plink.exe"
c.Arguments = "plink -ssh " & Server & " -l testUser -pw pass123 sudo /usr/bin/passwd -f " & frmPasswordResets.txtUsername.Text
c.WindowStyle = ProcessWindowStyle.Hidden
Process.Start(c)