Skip to content
ibMH edited this page Dec 1, 2020 · 4 revisions

How to use ssh

SSH basic use

If you want to use ssh you just have to use the following command: ssh ${USERNAME}@${HOSTADRESS} If you want to access the user "myuser" at the ip-adress 192.168.1.1 for example it looks like: ssh $myuser@$192.168.1.1 Afterwards you have to authorize by password.

Give meaning to ip-adress

Since the ip adress is a very unintuitive way to access a pc in network (you have to remember this adrees for each device) there are hostnames defined. These are given in a textfile at /etc/hosts. This textfile links a given ip adress to a human readable name. Such a file could look like:

192.168.1.1 gateway
192.168.12.20 computer
192.1668.12.50 robot

With these hostnames you can simplify the above ssh command to: ssh myuser@gateway and authorize by password.

I don't want to insert password!

Since it's uncomfortable to insert password each time a ssh connection is established you can authorizes by special keys. The key is generated on the accessing system by:

ssh-keygen -t rsa

and afterwards forwarded to the accessed system by:

ssh-copy-id -i ~/.ssh/id_rsa.pub ${HOSTNAME}

For our purposes settings should be stick to default/empty values by hitting the enter button for each request.

Clone this wiki locally