WinSCP directory browse

Associate
Joined
21 May 2003
Posts
1,365
I've set permissions on my htdocs directory to 765 ( rwx rw rx ).

I can open and browse this directory via putty, but attempting the same via WinSCP results in:
WinSCP said:
Server returned empty listing for directory '/wwwroot/htdocs'.

Any ideas? It appears I can only directory browse when I set execute permissions for the WinSCP user. Is this normal?
 
Thanks for the quick reply, I was struggling to find any information. Is having execute permissions set on htdocs for remote users a security issue? In which case I should use ftp rather than scp?
 
To browse directories you need execute permissions (as you are essentially "executing" a directory to list it's contents). On a UNIX system it shouldn't be a security problem as long as they don't have read/write access to sensitive files or system config files. This will be the case if you use FTP or SCP as it's the permissions on the UNIX box that are determining what access user(s) have to the file system once logged in.

If you want more atomic configuration of access rights you could a "ftpusers" or "SCPusers" group (using groupadd) and then add the users who require access to the directories by making them members of the group (usermod -G ftpusers username) and then chgrp -R 'ing the directory/ies you want them to access.
Finally, chmod -R g+rwx the directory to give the ftpusers group full access rights to that directory and it's subdirectories (although I would tend to go with read and execute only, and then give write access only to the directories and files where it is required.

N.B. This is purely a hypothetical example I've cobbled together off the top of my head, do a bit of background reading on the commands, their arguments and what they do before you letting them loose on a live system :)
 
Last edited:
Back
Top Bottom