Hello,
I would like to discuss with you about possibilities for FreeBSD Jailed SFTP server for someone to upload files.
What do you think about this method?
Maybe could it be easier to install with FreeBSD, so that a package handle it and prompt under CLI to make so.
Create a new user account with existing ftp group and /sbin/nologin shell:
Alternatively you can modify an existing account to share:
You need to set correct permissions to the user home directory and public directory inside for upload:
Now modify the SSHD server configuration file /etc/ssh/sshd_config and append:
Remember to restart the SSHD in order to apply new configuration:
Ref:
I would like to discuss with you about possibilities for FreeBSD Jailed SFTP server for someone to upload files.
What do you think about this method?
Maybe could it be easier to install with FreeBSD, so that a package handle it and prompt under CLI to make so.
There are situations when you have a nice server out there, and you want/need someone to upload important files, but you only want to give them a minimal access to the system. You can use SSHD with sFTP and /sbin/nologin shell for that in chroot environment (dedicated limited userspace). Note that SCP in fact requires a working shell, so you need to use sFTP in this case.
Create a new user account with existing ftp group and /sbin/nologin shell:
Code:
# adduser
Alternatively you can modify an existing account to share:
Code:
# pw groupmod ftp -m username
# pw usermod username -s /sbin/nologin
You need to set correct permissions to the user home directory and public directory inside for upload:
Code:
# chown root:wheel /home/username
# mkdir /home/username/public
# chown username:ftp /home/username/public
Now modify the SSHD server configuration file /etc/ssh/sshd_config and append:
Code:
Match Group ftp
ChrootDirectory /home/%u
ForceCommand internal-sftp
AllowTcpForwarding no
PermitTunnel no
X11Forwarding no
Remember to restart the SSHD in order to apply new configuration:
Code:
# service sshd restart
Once the account is not necessary anymore remember to remove it:
Code:
# pw userdel username
Ref:

FreeBSD sFTP SSHD chroot nologin
There are situations when you have a nice server out there, and you want/need someone to upload important files, but you only want to give them a minimal access to the system. You can use SSHD with…
www.tomek.cedro.info