Linux: ssh without password
Mon Aug 29 2022 14:01:35 GMT+0000 (Coordinated Universal Time)
Saved by
@marcopinero
# remote linux computer: 192.168.0.62 / example user: mybackup
# fist create user on remote machine: (don't forget password).
sudo adduser mybackup
# then, on local machine, generate public rsa key of our user.
# using local user (to be conected to remote) at user's home do:
ssh-keygen -t rsa
# to answer each question just press [ENTER].
# then from local folder user's home (/home/mybackup):
# 1) Create .ssh directory on remote machine:
ssh mybackup@192.168.0.62 mkdir -p .ssh
# 2) Copy generated key:
cat .ssh/id_rsa.pub | ssh mybackup@192.168.0.62 'cat >> .ssh/authorized_keys'
# 3) Change permissions:
ssh mybackup@192.168.0.62 "chmod 700 .ssh; chmod 640 .ssh/authorized_keys"
# 4) Test your login: (it must work without password):
ssh mybackup@192.168.0.62
content_copyCOPY
Login without password. It is very useful for backup issues.
Comments