Archived Forum Post

Index of archived forum posts

Question:

wq command in SSH lib for iOS

Sep 05 '12 at 17:01

Hi, I have a question about SSH Connection, does ssh lib for iOS support :wq command? When I try to type it always returns a "command not found" message


Answer

I don't entirely understand the question. Are you referring to ":wq" one might type while within the "vi" editor?


Answer

The only way to answer this question is to explain the fundamental concepts of an SSH shell session. The SSH lib does not provide "support" for individual commands. In other words, the library doesn't have code within it that somehow recognizes and supports every possible Linux/Unix command.

When you use the SSH lib to connect to an SSH server, authenticate, open a channel, and then start a shell session on the channel, you have a connection that behaves exactly as if you were typing into a terminal prompt. The text sent via Ssh.ChannelSendString (or ChannelSendData) is equivalent to typing that text at a terminal prompt. The data you read back is the standard output (and standard error). It doesn't make sense to ask if a particular command is "supported".