Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

Ubuntu/Debian:

sudo apt-get install -y openssh-server

CentOS/RHEL:

sudo yum install -y openssh-server
mkdir ~/.ssh
sudo nano ~/.ssh/authorized_keys
sudo nano ~/.ssh/id_rsa
sudo chmod 755 /home/$USER
sudo chmod 700 ~/.ssh
sudo chmod 400 ~/.ssh/id_rsa
sudo chmod 600 ~/.ssh/authorized_keys
sudo chown $USER:$USER ~/.ssh -R
sudo nano /etc/ssh/sshd_config && sudo service ssh restart

/etc/ssh/sshd_config

#AuthorizedKey file 
AuthorizedKey file (aka uncomment)

Note: SSH Is very picky about Permissions!

I've seen it fail if any of the following have bad permissions

/home/$USER
/home/$USER/.ssh
/home/$USER/.ssh/authorized_keys
/home/$USER/.ssh/id_rsa

To Debug:

tail -F /var/log/auth.log
  • No labels