Access with SFTP

SYSTEM INFORMATION
OS type and version Rocky Linux 8.6
Webmin version 2.201

Hello. I have created a user to access from the Windows 11 command line, using SFTP, only a specific folder.
The “home directory” is: /home/db_repository/docs
with permissions 755.
The “Shell” is: /bin/false.
The message I receive when trying to connect is directly “Connection closed”

If I change the shell to /bin/bash, the user accesses the root folder and sees all the folders, although he cannot navigate.
I try to connect by doing “sftp docs@162.19.89.212” or “sftp -P 22 docs@162.19.89.212”.

With the root user I do access well. Can you help me? Thanks in advance.

For a Windows user it is difficult to accept that any user of a Linux system can traverse the entire file system, but that is the norm.

If you enable chroot jail / Jailkit in Virtualmin, this traversal can be prevented but it does have a potential downside.

I think that is the solution that you are looking for.

Thanks, I’ll try it tomorrow

sftp -P 22 docs@162.19.89.212

This can’t work, if shell is /bin/false. That’s the ssh port.

If you want to connect to FTP over ssh protocol provided by ProFTPd you’d want port 2222.

You do not need to use chroot jails if you only want the user to have FTP access (including the ssh protocol). You just need to use the right port (2222) to talk to the FTP server.

Thanks Joe!!