I'm using a raspberry pi3 and VSFTPD to share a directory via FTP, which allows a camera to connect to it and transfer photos.
I also created a simple user & password and chrooted the directory so there's no file browsing outside of the dedicated folder if using FileZilla or any other tool.
The problem is, if i log in via the terminal (monitor, keyboard etc, no ssh), using that user, i'm free to go wherever i want, is there a way to prevent this?
I already tried:
usermod --expiredate 1
passwd -l
usermod -s /sbin/nologin
But this makes the account unusable.
If i search for jail/chroot terminal user, there's only 'ssh' results.
Any help will be greatly appreciated.
EDIT
By account unusable, i mean, it disables logging in via the terminal (which is what i want), but it also prevents connecting via FTP.
EDIT 2
The point is to disable everything for 1 user except the FTP folder, i don't need, and don't want that user to do anything.
Only FTP, no other protocol, i need to target all/most wi-fi cameras, and FTP is the way to go.
SFTP and SSH are disabled.
/sbin/nologon
? What are the requirements for the user account? Do you need interactive login? You could also usescp
instead of FTP and configure thessh
access as required. – Bodo Mar 29 '21 at 11:07nologin
. See https://serverfault.com/q/358324/625527 – Bodo Mar 29 '21 at 12:11