Difference between revisions of "SFTP chroot + rsync"
(Created page with "''af Tommy d. 18. feb.'' ChrootDirectory PLUS et traditionelt chroot. - en lyn-guide, nej nok nærmere notater. /etc/ssh/sshd_config #Subsystem sftp /usr/lib/openssh/sftp-...") |
|||
Line 3: | Line 3: | ||
ChrootDirectory PLUS et traditionelt chroot. - en lyn-guide, nej nok nærmere notater. | ChrootDirectory PLUS et traditionelt chroot. - en lyn-guide, nej nok nærmere notater. | ||
− | + | ==/etc/ssh/sshd_config== | |
#Subsystem sftp /usr/lib/openssh/sftp-server | #Subsystem sftp /usr/lib/openssh/sftp-server | ||
Subsystem sftp internal-sftp | Subsystem sftp internal-sftp | ||
Line 15: | Line 15: | ||
Herfra skal alle homefolders både ha root som owner og group for at virke. | Herfra skal alle homefolders både ha root som owner og group for at virke. | ||
− | + | ==Klargør gruppe== | |
addgroup sftponly | addgroup sftponly | ||
− | + | ==Opret bruger== | |
adduser user01 | adduser user01 | ||
addgroup sftponly | addgroup sftponly | ||
Line 24: | Line 24: | ||
− | + | ==Opret chroot miljø med bash og rsync== | |
mkdir /home/user01/bin | mkdir /home/user01/bin | ||
cp /usr/bin/rsync /home/user01/bin/ | cp /usr/bin/rsync /home/user01/bin/ |
Revision as of 13:25, 18 February 2013
af Tommy d. 18. feb.
ChrootDirectory PLUS et traditionelt chroot. - en lyn-guide, nej nok nærmere notater.
Contents
/etc/ssh/sshd_config
#Subsystem sftp /usr/lib/openssh/sftp-server Subsystem sftp internal-sftp Match group sftponly ChrootDirectory /home/%u X11Forwarding no AllowTcpForwarding no # ForceCommand internal-sftp
Herfra skal alle homefolders både ha root som owner og group for at virke.
Klargør gruppe
addgroup sftponly
Opret bruger
adduser user01 addgroup sftponly chown root:root /home/user01
Opret chroot miljø med bash og rsync
mkdir /home/user01/bin cp /usr/bin/rsync /home/user01/bin/ cp /bin/bash /home/user01/bin/
mkdir /home/user01/lib cp /lib/libncurses.so.5 /home/user01/lib/ cp /lib/libdl.so.2 /home/user01/lib/ cp /lib/libc.so.6 /home/user01/lib/ cp /lib/libacl.so.1 /home/user01/lib/ cp /lib/libpopt.so.0 /home/user01/lib/ cp /lib/libattr.so.1 /home/user01/lib/
mkdir /home/user01/lib64 cp /lib64/ld-linux-x86-64.so.2 /home/user01/lib64/