User Tools

Site Tools


servers:secure_shell

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
Last revisionBoth sides next revision
servers:secure_shell [2020/06/12 02:59] – [Information] Sean Rhoneservers:secure_shell [2020/06/12 03:10] Sean Rhone
Line 3: Line 3:
   * OpenSSH server notes   * OpenSSH server notes
   * See [[clients:secure_shell|SSH Client]] notes for clients   * See [[clients:secure_shell|SSH Client]] notes for clients
 +
 +====== Config Files ======
 +
 +===== Main =====
 +
 +****
 +
 +  sudo -e '/etc/ssh/sshd_config'
 +
 +===== Custom =====
 +
 +  * Check ''sshd_config'' to make sure ''sshd_config.d'' is included
 + 
 +<code>/etc/ssh/sshd_config.d</code>
  
 ====== Force Public Key Authentication ====== ====== Force Public Key Authentication ======
  
 +  * [[https://wiki.archlinux.org/index.php/OpenSSH#Force_public_key_authentication|ArchWiki]]
   * :!: Be sure to generate/restore keys and to copy to server before disabling passwords   * :!: Be sure to generate/restore keys and to copy to server before disabling passwords
   * :!: See [[clients:secure_shell|SSH Client]] notes   * :!: See [[clients:secure_shell|SSH Client]] notes
-  * :!: Check ''/etc/ssh/sshd_config'' to see what directory is used for ''.conf'' files if this doesn't work 
   * Tested on [[distros:ubuntu_server|Ubuntu 20.04]]   * Tested on [[distros:ubuntu_server|Ubuntu 20.04]]
  
Line 15: Line 29:
   sudo -e '/etc/ssh/sshd_config.d/custom-pubkey-only.conf'   sudo -e '/etc/ssh/sshd_config.d/custom-pubkey-only.conf'
  
-====== Secure Authorized Keys ======+===== Secure Authorized Keys =====
  
   * [[https://wiki.archlinux.org/index.php/OpenSSH#Securing_the_authorized_keys_file|ArchWiki]]   * [[https://wiki.archlinux.org/index.php/OpenSSH#Securing_the_authorized_keys_file|ArchWiki]]
  
   chmod '400' ~/'.ssh/authorized_keys'   chmod '400' ~/'.ssh/authorized_keys'
 +
 +====== Disable Root Login ======
 +
 +  * [[https://wiki.archlinux.org/index.php/OpenSSH#Deny|ArchWiki]]
 +
 +  echo 'PermitRootLogin no' | sudo tee '/etc/ssh/sshd_config.d/custom-root-login-disable.conf' > '/dev/null' && cat '/etc/ssh/sshd_config.d/custom-root-login-disable.conf'
 +
 +  sudo -e '/etc/ssh/sshd_config.d/custom-root-login-disable.conf'
  
/var/www/wiki/data/pages/servers/secure_shell.txt · Last modified: 2020/06/12 03:12 by Sean Rhone