Comp:ssh

From Theochem
Revision as of 10:13, 27 January 2021 by Gerritg (talk | contribs) (Using ssh)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

With the Linux ssh command you can logon to another server. You can configure ssh such that you do not have to enter your password every time again.

First make sure ssh is working

From you local linux computer login to the remote server, e.g., lilo7.science.ru.nl

 ssh username@lilo7.science.ru.nl

where you will have to replace username with your own username. If your username on the remote server is the same as on you local computer you can drop it:

 ssh lilo7.science.ru.nl

You will be asked to enter your password. The first time you give this command you will be asked to trust that you are connecting to right server. Later you will get a warning if lilo7.science.ru.nl is not the same server anymore - e.g., when your connection is being hacked or, more likely, when a mistake was made during a software upgrade on lilo7.

Login without password

First generate keys on your local computer:

 ssh-keygen

Accept all the defaults by giving enter (up to three times).

Now copy the local key to the remote server, e.g., to lilo7.science.ru.nl

 ssh-copy-id username@lilo7.science.ru.nl

You will have to enter your password, but the next time you logon with ssh you will not be asked for your password again.

Warning: if someone can break into your local computer, they will now also have access to lilo7.science.ru.nl

A more secure solution is to protect you private key with a passphrase:

Using a passphrase and an ssh-agent for security and ease