User Tools

Site Tools


Sidebar






newpage

linux:network:ssh

This is an old revision of the document!


SSH

secure shell…

Key authentication - login without password

Generate a (4096 bits long) private+public -key-pair on the local machine. To generate a key without password, just press enter:

ssh-keygen -b 4096

Find the public key in ~/.ssh/id_rsa.pub

To login on a remote machine without password, you need to add the public key to the file ~/.ssh/authorized_keys on that box.

less ~/.ssh/id_rsa.pub  # copy this

.. on the remote machine:

nano ~/.ssh/authorized_keys  # paste key in **ONE** line

Another option is to use the following command to add the key to authorized_keys on the remote machine:

ssh-copy-id -i .ssh/id_rsa.pub user@remoteserver


setup a tunnel

this creates a tunnel from local port 4950 to port 4949 on the remote machine, using a socket

ssh -L 4950:localhost:4949 -f -N -p222 -M -S /var/run/ssh_tunnel1.sock -o ExitOnForwardFailure=yes root@re.mo.te.IP


SSHFS - SSH Filesystem

Mount remote directories (for all users and reconnect, if network is interrupted)

Install:

apt-get install sshfs

Mount:

sshfs -p 222 root@server:/path/ /mnt/server -o allow_other -o reconnect
linux/network/ssh.1402921060.txt.gz · Last modified: 2014/06/16 14:17 by tkilla