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
Console.Write(response)

' disconnect from the server
ssh.Disconnect()

asked 30 May '11, 04:39

jepoy's gravatar image

jepoy
333
accept rate: 0%

edited 30 May '11, 04:46


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.

link

answered 30 May '11, 11:17

Lukas%20Matyska's gravatar image

Lukas Matyska ♦♦
90117
accept rate: 28%

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

(30 May '11, 12:10) jepoy
1

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.

(30 May '11, 12:39) Lukas Matyska ♦♦

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.

(31 May '11, 09:05) jepoy
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×141
×44
×7
×5
×5

Asked: 30 May '11, 04:39

Seen: 983 times

Last updated: 31 May '11, 09:05