Restrict Users to SCP and SFTP and Block SSH Shell Access with rssh
# cd /usr/ports/shells/rssh
# make install clean
FreeBSD – /usr/local/etc/rssh.conf
FreeBSD – /usr/local/bin/rssh
# useradd -m -d /home/didi -s /usr/bin/rssh didi
# passwd didi
Restrict Users to SCP and SFTP and Block SSH Shell Access with rssh
# cd /usr/ports/shells/rssh
# make install clean
FreeBSD – /usr/local/etc/rssh.conf
FreeBSD – /usr/local/bin/rssh
# useradd -m -d /home/didi -s /usr/bin/rssh didi
# passwd didi
Modify /usr/local/etc/sshd_config to include the following lines (your environment may vary):
# Use the following line to *replace* any existing ‘Subsystem’ line
Subsystem sftp internal-sftp
# These lines must appear at the *end* of sshd_config
Match Group sftponly
ChrootDirectory %h
ForceCommand internal-sftp
AllowTcpForwarding no
This means that all users you add to the ‘sftponly’ group will be chroot’d to their home directory, and will only be able to run the internal SFTP process.
===================================================
# Set their group (usermod -g) to sftponly (the group you created in the previous step)
# Set their shell (usermod -s) to /bin/false (to deny them shell access)
# Set their home directory (usermod -d) as you prefer
pouch
yogi
chicklet
well you know little D right?
green as a martian