Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
ssh command by default tries to reach ssh process on the server port 22.
Use ssh -p if followed by the port number ssh service is offered (if not standard ssh service port
used).
SSH client for Windows OS is PuTTY.
Usage:
ssh hostname -> After connection established, you are prompted for password, if default
configuration used. When connecting remotely SSH client tries to use user account you are
logged in with on the local machine.
ssh user@remoteserver -> use specific user account when connecting to server
ssh remoteserver -l user -> alternative way to connect using specific user account.
ssh -v -> use this option for verbosity during ssh connecting to troubleshoot problems with slow
ssh performance.
~/.ssh/known_hosts -> public key fingerprint upon first connection stored in this file, and used to
verify identity of the remote host.
ssh -X root@server -> temporarily allow remote host to draw graphical screens on your
computer.
Enable system wide forwarding of X11 applications by appending next line to file
/etc/ssh/ssh_config:
ForwardX11 yes
When authenticating using key pairs, the user generates a hash derived from the private key.
This hash is sent to the server, and if on the server it proves to match the public key that is
stored on the server, the user is authenticated.
To create a key pair, use the ssh-keygen command. The ssh-copy-id command is next used
to copy the public key over to the target server.
For maximum security protect private key with passphrase.
ssh-keygen -> create private/public key pair in ~/.ssh/ in id_rsa and id_rsa.pub.
ssh-copy-id root@remoteserver -> copy public key from id_rsa.pub to remote server and store
it in the ~/.ssh/authorized_keys.
Screen commands:
Ctrl+a, ? -> shows list of all commands that are available.
Ctrl+a, / -> close the screen session.
Use screen to work together with other users in the same session. To do this, follow these
steps:
1. Make sure that both users are using SSH to connect to the system where you want to
work on together. Both users must use the same user account when using SSH to
connect.
2. One user needs to start a screen session, using the screen command.
3. The second user can just connect to the screen session, using screen -x .