I work at a small company and use Putty on a windows machine to tunnel into our file server as "root." It is a very simple file server running Samba with about 30 users. Each user has distinct permissions (ACLs).

Now, I would like to know if there is a way for me to switch to another user while logged in as root in order to check the ACL permissions.

For example, I have tried: su username

This switches me to the username specified but it also gives the username superuser permissions, so when I enter a directory and then "ls" I see what root would see instead of seeing what the user would actually see without superuser permissions.

Thank you in advance for your assistance.

EDIT: This is the output of ls -lsa / | grep -e root$

4 drwxr-xr-x  43 root      root       4096 2011-02-23 11:54 root

su - username

This will switch to the user and reload the environment for said user. You'll notice that you're now in the username's home directory and not /root/.

Once you've done this, try ls -lsa /root/. You should no longer see any of the files there.

  • Thank you for your response. However, I am still able to see folders that the user should not be able to see (and cannot see when opening the same folder on their Windows PC). For example, in one directory there are 40 other directories. The user only has permissions to 8 and can only see 8 folders on their Windows PC. However, when I use su username, or su - username as you recommended I am seeing all 40 folders in the terminal window. – user249705 Feb 18 '14 at 21:42
  • Issue the command above and then do ls -lsa /| grep -e root$ and put the output of that in your first post as an edit. This will show us the permissions of the /root directory to diagnose. – earthmeLon Feb 18 '14 at 21:47
  • I'm not sure if we're on the same page or not. I am not concerned with root permissions and who can see the root directory exactly. I am trying to "see" what the Windows user sees when they open a directory. As it is right now, I am seeing what the root user would see when I open a directory (probably because I am logged in as the root user). But I want to limit what I see to what the user is seeing, if that makes sense. – user249705 Feb 18 '14 at 22:01
  • I understand that you have a system with a filesystem. You have multiple users. If this is a linux system, the user should not be able to see things owned by root:root. Is the filesystem SAMBA/sshfs setup and the files you're talking about are remote files? or are the files local? I'm sorry. You're right that we're not on the same page. – earthmeLon Feb 18 '14 at 22:09
  • My apologies for not explaining things better. Let me start over. We have a Linux server with Samba. Employees use a Windows PC to connect to the server through a mapped network drive. Each employee is registered as a separate user on the Linux machine (i.e. jdoe, rsmith, kjones) and each user has distinct file and folder permissions (ACLs) set with setfacl on the Linux machine. – user249705 Feb 18 '14 at 22:41

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.