0

I have a user "devuser" which when I log in via SSH can view all files. Specifically /var/www folders, there are 2 folders testsite mainsite. But when logging in via SSH using FTP in WinSCP application I can not view files owned by www-data. So I can see mainsite but not testsite. It seems as if my user permissions using ftp are different somehow.

I have tried adding my user "devuser" to the www-data group even after a server restart my user is not able to view the folder "testsite".

I'm using Debian 8 & Nginx to serve web pages.

If I have not provided enough info I apologise in advance, please let me know what to provide.

ls -la in www folder shows:

drwxrwsr-x  4 root     root     4096 Sep 27 21:20 .
drwxr-xr-x 12 root     root     4096 Sep 27 21:20 ..
drwxrwsr-x  8 www-data www-data 4096 Sep 27 21:20 testsite
drwxrwsr-x  2 root     root     4096 Sep 27 21:20 mainsite

cat of /etc/passwd:

devuser:x:1000:1000:devuser,,,:/home/devuser:/bin/bash
0

It is not entirely clear from your answer, but I am suspecting you are using the sftp subsystem of openssh.

If that is the case, please see my answer here:

Best practice for WordPress, direct auto updates and SFTP access for users

As well as:

bad ownership or modes for chroot directory component

ChrootDirectory
Specifies the pathname of a directory to chroot(2) to after authentication. All components of the pathname must be root-owned directories that are not writable by any other user or group. After the chroot, sshd(8) changes the working directory to the user's home directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.