I currently know how to allow a user either SSH or sFTP by editing:
/etc/ssh/sshd_config
This lets the user login with SSH but not SFTP:
Subsystem sftp /usr/lib/openssh/sftp-server
Match group chrootedgroup
ChrootDirectory /var/chroot/
This lets the user use sFTP but not SSH:
Subsystem sftp internal-sftp
Match group chrootedgroup
ChrootDirectory /var/chroot/
ForceCommand internal-sftp
How can I make a user capable of logging in using both?
I encountered same problem, figured out through the help of https://www.howtoforge.com/restricting-users-to-sftp-plus-setting-up-chrooted-ssh-sftp-debian-squeeze#-enabling-chrooted-ssh Solution mentioned in the last few lines of the section 'Enabling Chrooted SSH'.
To support both SSH and SFTP, your configuration should be:
Subsystem sftp internal-sftp Match group chrootedgroup ChrootDirectory /var/chroot/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With