HuyPV
Wednesday, January 4, 2012
#On my pc (local)
ssh-keygen -t rsa
cd
scp .ssh/id_rsa.pub root@server:/root/
#On my server
cd /root
cat id_rsa.pub >>/root/.ssh/authorized_keys
chmod 700 /root/.ssh/authorized_keys
vim /etc/ssh/sshd_config
--> Config: PermitRootLogin yes
/etc/init.d/sshd restart
#On my pc
ssh root@server
--> enjoy
# Bonus rsync command with include
rsync -e ssh -arv --delete --include="/uploads/" --include="/cache/" --exclude="/*" root@server:/srv/www/dantri/web/ /home/backup/web/
/srv/www/dantri/web/
uploads
cache
...
Title:
scp, ssh and rsync without prompting for password
Description:
#On my pc (local) ssh-keygen -t rsa cd scp .ssh/id_rsa.pub root@ server :/root/ #On my server cd /root cat id_rsa.pub >>/root/....
...
Rating:
4