hi i want to make user login via ssh will be jailed to his directory..
newbie here, i find alot of tutorial about jail ssh, but all the result give me back the sftp result.
i hv did alot of configuration and makes me more confuse
Code:
groupadd sftponly
usermod sftponly user
#Subsystem sftp /usr/lib/openssh/sftp-server
Subsystem sftp internal-sftp
Match Group sftponly
ChrootDirectory /aaa/home/%u
X11Forwarding no
AllowTCPForwarding no
ForceCommand internal-sftp
user from group sftponly will not be able to access to server via ssh/sftp.
Error: Software caused connection abort.
i have added/delete AllowGroups,
swap # between internal-sftp || /usr/lib/openssh/sftp-server
all still have the same error
or i have manually added
Code:
# mkdir /aaa
# cd /aaa
# mkdir {bin,dev,lib64}
# cp -p /bin/bash bin/
# cp -p /lib64/*.* lib/64
# mknod dev/null c 1 3
# mknod dev/zero c 1 5
# chmod 0666 dev/{null,zero}
# useradd -m -d /aaa/home/ch5 -s /aaa/bin/bash ch5
i can login ch5 via ssh, but not jailed
if i add user ch5 into group sftponly
it will have the same error as above
anyone pls help, or if i hv gone wrong too deep, just give me an exmaple of this .thanks
oh i have also use makejail.sh
http://www.fuschlberger.net/programs...p-chroot-jail/
sh makejail.sh ch6 /bin/bash /export
still cannnot
please help ,ty