Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Ubuntu/Debian:

No Format
sudo apt-get install -y openssh-server

CentOS/RHEL:

No Format
sudo nano /etc/ssh/sshd_config
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

Note: If you mess with Permissions, SSH will SILENTLY FAIL. Here are correct Perms

No Format
 sudo chmod 700 ~/.ssh && sudo chmod 600 ~/.ssh/authorized_keys && sudo chown $USER:$USER ~/.ssh -R && sudo service ssh restart

/etc/ssh/sshd_config

No Format
change LogLevel INFO to VERBOSE
#PasswordAuthentication yes
PasswordAuthentication no #Disables login via Username/PWD
PermitRootlogin no
#AuthorizedKey file 
AuthorizedKey file (aka uncomment)

 

 
yum install -y openssh-server

Create Keys:

Note: This does NOT matter what server you make them on, and the end of the public key, which has your username & computer name, is JUST A COMMENT. You can delete it.

No Format
ssh-keygen -t rsa

Copy your keys to a safe location.

No Format
id_rsa = Private Key
id_rsa.pub = Public Key (Store in ~/.ssh/authorized_keys)

Now just follow my guide on setting up your server w/ your RSA Keys. You should keep these keys in a safe place.