I've been looking around for a few days now, playing around with configurations and following tutorials on this.
I Have two groups: dev and sftp.
Users within the dev group are also part of the www-data and svn groups. These users are to be chrooted to their home directory. I would like them to have access to /var/www either via a symbolic link, or somehow mounting the directory for them.
Users within the sftp group, cannot ssh, but should be allowed to sftp.
Background
I attempted to configure the sshd_config to allow sftp group sftp only access, restarted ssh and it dropped. Fortunately when dealing with the sshd_config I prepare a failsafe to revert the config and restart by cron every 10 miniutes in this event. Nevertheless, I couldn't find an alternative or get this method to work.
Edit !!
After reviewing the answers below, would an alternative be advised? I run Ubuntu - therefore the root user is locked, and ssh_config
rejects root login. Also sudoers has 2 permitted groups within its config, srv-admin and sudo (sudo cannot kill, reboot, upgrade etc).
The group dev
is to allow the user access to 2 directories, /home/<user>
and /var/www
.
The group sftp
is ONLY to allow the user SFTP access, nothing more, and NO SSH.
Sounds like I'm misunderstanding the use of chroot in thus scenario.