Metafor

ULiege - Aerospace & Mechanical Engineering

User Tools

Site Tools


devel:misc:ssh

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
devel:misc:ssh [2016/04/26 17:33] boemerdevel:misc:ssh [2016/05/13 16:45] – [SSH - network services] boman
Line 3: Line 3:
 A guide about how to configure and use SSH in Ubuntu.  The following questions will be answered in this guide: A guide about how to configure and use SSH in Ubuntu.  The following questions will be answered in this guide:
  
- * How to log into a remote machine?+  * How to log into a remote machine?
  
- * How to configure the login properly with an SSH key and a config file?+  * How to configure the login properly with an SSH key and a config file?
  
- * How to transfer files from one machine to another?+  * How to transfer files from one machine to another?
  
  
Line 34: Line 34:
 ==== SSH keys ==== ==== SSH keys ====
  
-SSH keys are similar to passwords.  They can be created by the command ''ssh-keygen'' During the creation of the key files, the user is asked to enter a keyphrase.  This keyphrase is an additional password, which can be used with the key files.  If you do, however, not want to add any further security, you can simply press Enter.  The ''ssh-keygen'' command then creates two files in the ''.ssh'' directory (in ''$HOME''): a private identification key called ''id-rsa'' and a public verification key ''id-rsa.pub''.  +SSH keys are similar to passwords.  They can be created by the command ''ssh-keygen'' During the creation of the key files, the user is asked to enter a keyphrase.  This keyphrase is an additional password, which can be used with the key files.  If you do, however, not want to add any further security, you can simply press Enter.  The ''ssh-keygen'' command then creates two files in the ''.ssh'' directory (in ''$HOME''): a private identification key called ''id_rsa'' and a public verification key ''id_rsa.pub''.  
  
-The public key has to be transfered to the remote machine by the command ''ssh-copy-id username@machine'', e.g. ''ssh-copy-id boemer@clifton.ltas.ulg.ac.be'' This command adds the alpha-numeric key in ''id-rsa.pub'' to the file ''.ssh/authorized_keys'' on the remote machine.+The public key has to be transfered to the remote machine by the command ''ssh-copy-id username@machine'', e.g. ''ssh-copy-id boemer@clifton.ltas.ulg.ac.be'' This command adds the alpha-numeric key in ''id_rsa.pub'' to the file ''.ssh/authorized_keys'' on the remote machine.
  
-When you try to connect for the next time to the remote machine, no password will be asked since the ssh command compares your private key in ''.ssh/id-rsa'' with the public key in ''.ssh/authorized_keys'' on the remote machine.  If the comparison is successful, the connection is established.  In reality, a more complex operation than a simple comparison is performed.  See [[https://en.wikipedia.org/wiki/RSA_%28cryptosystem%29|RSA]].+When you try to connect for the next time to the remote machine, no password will be asked since the ssh command compares your private key in ''.ssh/id_rsa'' with the public key in ''.ssh/authorized_keys'' on the remote machine.  If the comparison is successful, the connection is established.  In reality, a more complex operation than a simple comparison is performed.  See [[https://en.wikipedia.org/wiki/RSA_%28cryptosystem%29|RSA]].
  
  
Line 46: Line 46:
   ssh boemer@fabulous.ltas.ulg.ac.be   ssh boemer@fabulous.ltas.ulg.ac.be
      
-The easiest way to do so is to copy your private key ''id-rsa'' to the first remote machine, provided that the public key ''id-rsa.pub'' has already been trasfered to the second remote machine by the ''ssh-copy-id'' command.  The private key is transfered to the first remote machine by the following command:+The easiest way to do so is to copy your private key ''id_rsa'' to the first remote machine, provided that the public key ''id_rsa.pub'' has already been trasfered to the second remote machine by the ''ssh-copy-id'' command.  The private key is transfered to the first remote machine by the following command:
  
-  scp .ssh/id-rsa boemer@clifton.ltas.ulg.ac.be:.ssh/+  scp .ssh/id_rsa boemer@clifton.ltas.ulg.ac.be:.ssh/
  
 </note> </note>
  
  
-<note important> It might happen that your file permissions in the ''.ssh'' folder are not sufficiently restrictive.  To change these permissions execute the following command in the home directory+<note important> It might happen that your file permissions in the ''.ssh'' folder are not sufficiently restrictive.  To change these permissions execute the following command in the home directory:
  
   chmod -R 700 .ssh   chmod -R 700 .ssh
      
-This command sets the permission recursively for all files in the ''.ssh'' directory to read/write/execute only allowed by the user. </note>+This command sets the permission recursively for all files in the ''.ssh'' directory to "read/write/execute only allowed by the user". </note>
  
  
-<note warning> Previously, it was suggested to copy your private key ''id-rsa'' on all machines.  Notice that whoever has this key can access your machines.  It is as if he had your password.  So pay attention to not leave this file on machines accessible by people, who you do not know. </note>+<note warning> Previously, it was suggested to copy your private key ''id_rsa'' on all machines.  Notice that whoever has this key can access your machines.  It is as if he had your password.  So pay attention to not leave this file on machines accessible by people, who you do not know. </note>
  
  
devel/misc/ssh.txt · Last modified: 2017/07/10 18:12 by boemer

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki