Chapter 3: SSH Client Commands
__Linux 101 Hacks
Hack 12. Identify SSH Client Version
$ ssh -V
OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003
The following example indicates that this particular system is using SSH2:
$ ssh -V
ssh: SSH Secure Shell 3.2.9.1 (non-commercial version)
on i686-pc-linux-gnu
Hack 13. Login to Remote Host using SSH
localhost$ ssh -l jsmith remotehost.example.com
Hack 14. Debug SSH Client Session
localhost$ ssh -l jsmith remotehost.example.com
warning: Connecting to remotehost.example.com failed:
No address associated to the name
locaclhost$ ssh -v -l jsmith remotehost.example.com
Hack 15. Toggle SSH Session using SSH Escape Character
come back to the localhost to perform some activity and go back to remote host again.
localhost$ ssh -l jsmith remotehost
remotehost$
remotehost$ ~^Z
[1]+ Stopped ssh -l jsmith remotehost
localhost$localhost$ jobs[1]+ Stopped ssh -l jsmith remotehostlocalhost$ fg %1ssh -l jsmith remotehostremotehost$
Hack 16. SSH Session Statistics using SSH Escape Character
localhost$ ssh -l jsmith remotehost
#type ssh escape character ~ followed by s
#Note: The ~s is not visible on the command line when you type.