Find the answer to your Linux question:
Results 1 to 7 of 7
Hi... After reading up about ssh, I understand that it's a protocol used for sending encrypted data over a network. However, I don't understand what's going on when I login ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2008
    Posts
    36

    How does ssh remote login work?


    Hi... After reading up about ssh, I understand that it's a protocol used for sending encrypted data over a network. However, I don't understand what's going on when I login to my Ubuntu PC using ssh [over the network]. How does the ssh client application 'know' that it has to take input from one computer and pass it to the other?

    EDIT; To put it another way, one could send a mp3 file over ssh right? So instead of the file, what tell the ssh client that the input and output of the computers is what has to be sent?

  2. #2
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    The core concept is that standard input and output are kept flexible in Unix systems.

    Instead of expecting input from the from a physical keyboard, applications read input from the more abstract STDIN 'file'. Likewise, the output goes to STDOUT with no concern as to whether this is the screen, a line printer or another program.

    http://en.wikipedia.org/wiki/Redirection_(computing)
    Debian GNU/Linux -- You know you want it.

  3. #3
    Just Joined!
    Join Date
    Apr 2008
    Posts
    36
    hm.. interesting. So the server must be able to redirect STDOUT to the ssh client.. right?

  4. #4
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    Not directly to the client.
    The SSH server reads the output of the program, then sends it over network to the client.
    Debian GNU/Linux -- You know you want it.

  5. #5
    Just Joined!
    Join Date
    Apr 2008
    Posts
    36
    Thanks.. But how does ssh enable one to loggin to a virtual text based terminal? is the ssh server running in the background?

  6. #6
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    Yes, it's running in the background and listens for incoming SSH connections.
    If a new connection is established and authenticated correctly, the server program spawns a twin of itself (so the server can keep listening for new connections) and starts a shell (like bash) whose output is send to the client.
    Debian GNU/Linux -- You know you want it.

  7. #7
    Just Joined!
    Join Date
    Apr 2008
    Posts
    36
    Thanks for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •