User Tools

Site Tools


tutorials:remote_access

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
tutorials:remote_access [2012/03/03 00:40] chkuotutorials:remote_access [2019/01/11 17:35] (current) – [Key] chkuo
Line 18: Line 18:
  
 ==== Key ==== ==== Key ====
-To generate key-pairs, use: <code bash>ssh-keygen -t 'rsa'</code> +To generate key-pairs, use: <code bash>ssh-keygen -t rsa -b 4096</code>
  
-This command will create a pair of private key (''~/.ssh/id_rsa'') and public key (''~/.ssh/id_rsa.pub''). To enable authentication on a remote host, append the public key to the ''~/.ssh/authorized_keys'' file in the remote host.+This command will create a pair of private key (''~/.ssh/id_rsa'') and public key (''~/.ssh/id_rsa.pub''). To enable authentication on a remote host, append the public key to the ''~/.ssh/authorized_keys'' file in the remote host (this file should be owned by the user and have the ''644'' permissions). 
 + 
 +If the home directory is encrypted, ''authorized_keys'' would not work while within the home directory before the user is logged in. Move the ''authorized_keys'' file and modify ''/etc/ssh/sshd_config'' accordingly. 
 +For example (see [[https://help.ubuntu.com/community/SSH/OpenSSH/Keys#Troubleshooting]]: 
 +  * set up ''/etc/ssh/<username>'' (owned by user, 755 permissions).  
 +  * in ''/etc/ssh/sshd_config'', add ''AuthorizedKeysFile    /etc/ssh/%u/authorized_keys'' 
 +  * restart sshd: ''sudo service ssh restart''
  
 ==== Keep alive ==== ==== Keep alive ====
tutorials/remote_access.1330706436.txt.gz · Last modified: by chkuo