I am trying to create chroot environment on Ubuntu server 14.04. This is the chroot user and group i created:
Code:
max@ubuntu:~$ cat /etc/passwd | grep demo demo:x:1002:1003:,,,:/home/demo:/usr/sbin/nologin
Code:
max@ubuntu:~$ cat /etc/group | grep sftpusers sftpusers:x:1002:demo
Code:
max@ubuntu:~$ tail /etc/ssh/sshd_config
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes
Subsystem sftp inteal-sftp
Match Group sftpusers
ChrootDirectory /sftp/demo
ForceCommand inteal-sftp
Code:
max@ubuntu:~$ ll /sftp/ total 12 drwxrwxr-x 3 root root 4096 Feb 29 18:06 ./ drwxr-xr-x 22 root root 4096 Feb 15 17:21 ../ drwxrwxr-x 2 root sftpusers 4096 Feb 15 17:22 demo/
Code:
$ sftp demo@192.168.56.105 demo@192.168.56.105's password: Coection reset by 192.168.56.105 Coection closed
- - , .
برچسب:
نویسنده: استخدام کار