A question arose in a group discussion: Can directory listing be disabled for sftp while still retaining read and write access?
We are using openssh on ubuntu server 11.02 if that helps.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
I do not think so.
I found nothing in the sshd_config man-page that gives a hint about restricting sftp-commands (like the restricitons you can impose on some ftp-daemons).
I have not tested this, but perhaps you can alias the
ls command to something that does nothing in ssh-context (so either in .sshrc or via forced-command).
I just recently set up a chroot sftp system, and as I was testing, I noticed that a chrooted user with a shell of /bin/false was not able to executer
ls without getting kicked out. The sshd_config is also using internal-sftp-server.
I haven't had time to investigate it yet, but I suspect that internal-sftp-server is trying to spawn a sub-shell, and is being denied, since the user's shell is /bin/false. It's just a theory.
FWIW, my user's home directory is root:root 755.