PDA

View Full Version : ssh daemon question



Overworked_PhD
07-07-2009, 09:26 AM
I'm not that sure if I should post this question here or the tech forum. ....


Someone told me that an interactive ssh session works like the following



When you do an interactive SSH login, stdin and stdout are connected to
a pseudo-tty, which is connected to sshd on the server, which is
connected to the TCP socket, which is connected to the ssh client.



Now let's say that I have a remote application chatroom application called party on this server and I invoked it from my machine like the following



ssh -t cd@someserver.com party


Here is my question. Would the party program get called before the sshd on the server connects to the TCP socket or after?

brewbuck
07-07-2009, 09:39 AM
Here is my question. Would the party program get called before the sshd on the server connects to the TCP socket or after?

How could it possibly get called before? Does the ssh server have the ability to predict the future? How would it even know which program should be executed unless the client tell it, and how could the client tell it without being connected?

Kennedy
07-07-2009, 09:41 AM
If I'm understanding your question correctly (and if I understand the ssh man page correctly), the answer to your question is AFTER.

ssh attempts to connect to the remote machine on a socket. Next, your credentials are transmitted across that (secured -- by encryption) socket. Finally, the command "party" would be sent.

Andy

Overworked_PhD
07-07-2009, 11:23 AM
How does pseudo terminal connect to the ssh daemon without first connecting to the TCP socket?

Kennedy
07-07-2009, 11:44 AM
It doesn't.