Match User backup
ChrootDirectory /var/backup
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
2) # kill -HUP `cat /var/run/sshd.pid`
3) create the new user, generate key, and set permissions:
# mkdir -p /home/backup/.ssh
# useradd backup
# ssh-keygen -t dsa
# cp id_dsa.pub /home/backup/.ssh/authorized_keys
# mkdir -p /var/backup/dir1
# chown root:wheel /var/backup
# chmod 755 /var/backup
# chown backup /var/backup/dir1
3) edit a batch file, sftp_batch for sftp:
cd dir1
put myfile
4) then, fireup sftp client for batch processing now!
# sftp -b sftp_batch backup@localhost
REFERENCES:
http://www.howtoforge.com/chrooted-ssh-sftp-tutorial-debian-lenny
No comments:
Post a Comment