Setting up SSH access to enos.itcollege.ee: Difference between revisions

From ICO wiki
Jump to navigationJump to search
No edit summary
Line 40: Line 40:
You will then be asked to enter your ITCollege password, and then you will be prompted to enter your passphrase (to make sure that you the owner of the private key you are trying to use).
You will then be asked to enter your ITCollege password, and then you will be prompted to enter your passphrase (to make sure that you the owner of the private key you are trying to use).


That's it! Now you can access your Enos space without entering your password: try ssh <code>your-itcollege-username''@enos.itcollege.ee</code>
That's it! Now you can access your Enos space without entering your password: try ssh <code>''your-itcollege-username''@enos.itcollege.ee</code>

Revision as of 16:59, 12 January 2016

Secure Shell, or SSH, is a cryptographic (encrypted) network protocol to allow remote login and other network services to operate securely over an unsecured network.

With SSH, you generate two keys: one Public and one Private. The public key is not secret, anybody can have it if they want to. Whereas your private key is very important and must not be shared! Your public key is not secret because it must be stored in each server/computer/device you will want to access with your private key. The public key is like the same lock that you install at the front-door of all your houses/apartments (suppose you have many). To enter all those houses/apartments you only need your private key (which only you possess).

By default your keys are stored in the home folder, in a hidden directory called .ssh where the public key is stored in the file id_rsa.pub and your private key in the file id_rsa.

Generate new keys

   ssh-keygen -t rsa -b 4096 -C "write your comment here"

-t is to setup the type of encryption: rsa in our case.

-b is to set the number of bits in the key to create: 4096 in our case.

-C is to set a comment for this key: for example you can write "Enos key" or "Private server". Don't forget the double quotes in your comment.


Then you will be asked where to save the key. We suggest you save it in the default location by just hitting Enter.


You'll be asked to enter (and to confirm) a passphrase. A passphrase is like a password to make sure that your private key will remain secure even if somebody steals/copies it. We strongly advise you to create a long one (you can use any character you like) and remember it.


After you enter a passphrase, review the fingerprint, or id, of your SSH key. Your keys have been created! You should see the id_rsa.pub and id_rsa files in your .ssh directory.


Take a look at your public key to see what it looks like:

   cat ~/.ssh/id_rsa.pub

Notice your comment at the end of the key.


Copy your public key to Enos

Now you need to copy your public key into your enos.itcollege.ee space. In case you have already some keys stored there, we will add the newly-created key to Enos by

   cat ~/.ssh/id_rsa.pub | ssh your-itcollege-username@enos.itcollege.ee 'cat >> .ssh/authorized_keys'

You will then be asked to enter your ITCollege password, and then you will be prompted to enter your passphrase (to make sure that you the owner of the private key you are trying to use).

That's it! Now you can access your Enos space without entering your password: try ssh your-itcollege-username@enos.itcollege.ee