docs / linux / installing-ssh-keys

installing ssh keys

linux updated 2025-06-20
textcopy
ls ~/.ssh/authorized_keys
textcopy
mkdir ~/.ssh
chmod 700 ~/.ssh
touch ~/.ssh/authorized_keys
chmod 0644 ~/.ssh/authorized_keys
nano ~/.ssh/authorized_keys
textcopy
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
nano /etc/ssh/sshd_config
systemctl restart sshd

if root user not permited to log in

textcopy
sudo sed -i ‘s/#PermitRootLogin prohibit-password/PermitRootLogin yes/’ /etc/ssh/sshd_config