Set Users as chrooted for sftp, but allow user to login in SSH
- by Eghes
I have setup a ssh server on debian 7, to use sftp connection.
I chrooted some user, with this config:
Match Group sftpusers
ChrootDirectory /sftp/%u
ForceCommand internal-sftp
But if i want login with one of this chrooted users in ssh console, they get logged, but autoclose the connection. In logs I see:
Oct 17 13:39:32 xxxxxx sshd[31100]: Accepted password for yyyyyy from zzz.zzz.zzz.zzz port 7855 ssh2
Oct 17 13:39:32 xxxxxx[31100]: pam_unix(sshd:session): session opened for user yyyyyyyyyyyy by (uid=0)
Oct 17 13:39:32 d00hyr-ea1 sshd[31100]: pam_unix(sshd:session): session closed for user yyyyyyyyyyyy
How can I chroot a user only for sftp, and use it as a normal user for ssh?