0 votes
by (450 points)

Hello Guys,

I wonder why am I getting "sh: site: command not found" when i run the following code?

' create an Ssh object
Dim ssh As Ssh = New Ssh()

Dim privateKey As New SshPrivateKey(_PrivateKeyFileLocation, _Password)

' connect to the server
ssh.Connect(_AkamaiHostName, _Port)

' login to the server
ssh.Login(_AkamaiUploadUserName, privateKey)
Dim shell As Shell = ssh.StartCommand("site az2z")

' get the response of the command
Dim response As String = shell.ReadAll()

'write the response

' disconnect from the server

1 Answer

+1 vote
by (70.3k points)

The "sh: site: command not found" message is the error message of the remote shell (remote SSH shell you are connected using the ssh.Connect(_AkamaiHostName, _Port) call).

It tells you the remote shell doesn't know the SITE command. The SITE command is one of the FTP command, but you are connected to an SSH server.

To learn about differences between FTP/FTPS/SFTP/SSH please visit our knowledge base article.

by (450 points)

oh so you're saying that FTP command cannot be executed using SSH? :)

by (70.3k points)

Exactly, FTP and SSH are two different protocols. To know which commands are available on your SSH server, please connect to your server using the PuTTY client and give it a try.

by (450 points)

thank you... I will give it a try and what you said makes a lot of sense to me too :) i do really appreciate your help thanks matyska.