ssh

Rsync SSH backup script

cat <<EOF> ~/privat/scripts/backup.ssh.sh
#!/bin/bash
 
nice -n 20 rsync -avze ssh --delete --exclude-from=/home/pako/.gvfs /home/pako pako@fs:/mnt/pakonb
EOF

SSH authentication with pre-shared key

Create new key on client
ssh-keygen -t rsa
(confirm with 3x with enter to leave passphrase empty)

Copy public key to server
ssh-copy-id ${USER}@192.168.0.1

Test login
ssh -v ${USER}@192.168.0.1

login with master key
ssh -i ./backup_ssh_key/id_rsa USER@YOUR_SERVER

import own ssh key by using previous / master ssh key
cat ~/.ssh/id_rsa.pub | ssh -i ./backup_ssh_key/id_rsa USER@YOUR_SERVER 'cat >> .ssh/authorized_keys'

OPTIONAL: disable password login

Do you like this page? Then support it. Please click the AD below and visit the sponsor. Thank you!


Syndicate content