i have two machines

  • local machine
  • remote machine

i want to backup my files and folders automatically to the remote machine and doing that by Rsync command for transfer files and folder using ssh-keygen for automatically login to the remote machine

i can do it as ssh root but that will be a bit of security risk if someone can login directly to the remote machine as root if the local files has been compromised

i tried rssh but i couldn't try to login automatically using ssh-keygen

what iam looking for is how to create a ssh user with limited shell commands and specific directory safe for automatically login with no harm to the remote machine

link|improve this question

33% accept rate
I'm not really sure this will work for you. If you can rsync files over, it may be possible to rsync a replacement authorized_keys file that doesn't have that restriction. – devicenull Dec 23 '11 at 14:20
feedback

2 Answers

up vote 5 down vote accepted

You can limit the command run when using a ssh key-pair by using command="...." into ~/.ssh/authorized_keys file. Example took from here:

$ cat ~/.ssh/authorized_keys 
command="/usr/local/bin/rsync --server -vlogDtprz --delete . /tmp",no-pty,no-agent-forwarding,no-port-forwarding ssh-rsa AAAAB3NzaC1y[...] kattoo@spaghetti
link|improve this answer
feedback

We use rsnapshot with combination of keychain and validating script following this guide: http://www.tarfu.se/hacking/35/46

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.