User Tools

Site Tools


servers:secure_shell

Differences

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

Link to this comparison view

Next revision
Previous revision
servers:secure_shell [2020/06/12 02:59] – created Sean Rhoneservers:secure_shell [2020/06/12 03:12] (current) – [Information] Sean Rhone
Line 1: Line 1:
 ====== Information ====== ====== Information ======
  
-  * Various commands for an OpenSSH server +  * OpenSSH server notes 
-  * See [[clients:secure_shell|SSH Client]] notes for clients+  * See [[clients:secure_shell|OpenSSH 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/attic/servers/secure_shell.1591945179.txt.gz · Last modified: 2020/06/12 02:59 by Sean Rhone