How to Access Other User Home Directory Linux
If you need to know how to access other user home directory linux, the usual answer is to use sudo or a root shell, because normal users cannot browse another user’s home directory unless permissions explicitly allow it. In many cases, the real issue is not the home folder itself, but the permissions on the directory and on its parent folders such as /home.
What this means in Linux
On Linux, every file and directory has an owner, a group, and permission bits. A user’s home directory, often something like /home/alice, is usually private by default. That means another user may not be able to list, open, or enter it unless the system administrator has granted access.
Two permissions matter most for directories:
- Read, which allows listing the directory contents.
- Execute, which allows entering the directory and accessing items inside it if you already know their names.
If you cannot enter another user’s home directory, the parent path may also be blocking access. For example, if /home is not searchable by your account, you will hit a permission error even before reaching the target directory.
When you can access another user’s home directory
You can access another user’s home directory only when at least one of these is true:
- You are the root user.
- You use sudo to run a command with elevated privileges.
- The directory permissions or ACLs explicitly allow your user or group to access it.
- You are part of a shared group with access to that directory or specific files.
If none of those apply, Linux will usually deny access for good reason: user home directories often contain private data, SSH keys, shell history, and personal configuration files.
Check the permissions first
Before trying to open the directory, inspect ownership and permissions. This helps you understand whether the problem is the home folder itself, a parent directory, or a specific file.
| Command | What it shows | Why it helps |
|---|---|---|
ls -ld /home/username | Owner, group, and permissions on the home directory | Shows whether the directory is private or shared |
ls -ld /home | Permissions on the parent directory | Shows whether you can traverse into the home path |
stat /home/username | Detailed ownership and mode information | Useful for deeper troubleshooting |
Example:
ls -ld /home /home/aliceA typical private setup might look like this:
drwxr-xr-x 5 root root 4096 Mar 10 09:00 /home
drwx------ 18 alice alice 4096 Mar 11 14:22 /home/aliceIn this example, /home/alice is private. Only Alice and root can enter it unless access has been granted another way.
How to access it with sudo
The safest practical way for an administrator to access another user’s home directory is usually to run the command with sudo. This keeps the elevated privilege limited to the task you are performing.
- List the directory as root
Usesudo ls /home/usernameto see the contents if permissions allow it. - Enter the directory using a root shell
Usesudo -iorsudo su -to switch to a root login shell, then navigate to the directory. - Read a specific file
Usesudo cat /home/username/file.txtorsudo less /home/username/file.txtinstead of changing ownership.
Examples:
sudo ls -la /home/alice
sudo cat /home/alice/.bashrc
sudo less /home/alice/Documents/report.txtThis approach is often better than logging in as another user or changing file ownership, because it avoids unnecessary changes to the system.
How to use a root shell safely
If you need to inspect several files or move around the directory tree, a root shell may be more convenient. Still, use it carefully.
sudo -i
cd /home/alice
ls -laor:
sudo su -
cd /home/alice
ls -laA root shell gives broad access, so keep the session short and avoid editing files unless you are sure what they do. If your only goal is to view one or two files, single commands with sudo are usually safer.
Why permission denied happens
The most common reasons you see Permission denied are:
- The home directory is owned by another user and is not world-readable.
- The directory lacks the execute bit for your user or group.
- The parent directory, often
/home, does not allow traversal. - There is an ACL or security policy that blocks access.
- You are trying to open a file inside the directory without permission on the directory itself.
Remember that directory permissions are different from file permissions. Even if a file is readable, you may still need execute permission on the directory that contains it to reach the file path.
Safer ways to share files between users
Directly opening another user’s home directory is not always the best solution. If two users need regular access, use a shared method instead of relying on root every time.
Shared group directory
Create a directory owned by a shared group, then grant both users membership in that group. This is a common choice for team workspaces.
Access control lists
ACLs let you grant a specific user access to a directory or file without changing the main ownership model. This is useful when only one extra person needs access.
Separate shared folder
Instead of using a private home directory, create a dedicated folder such as /srv/shared or /home/shared with clearly defined permissions.
In general, these options are better than making a personal home directory broadly readable, because they keep private data protected while still supporting collaboration.
Common examples
Here are a few practical cases and the usual response:
- You are an admin and need to read one file: use
sudo cat,sudo less, orsudo nanoif editing is required. - You need to copy a file out of another user’s directory: use
sudo cp /home/username/file /tmp/or another safe destination. - You need ongoing team access: set up a shared group or ACL, not a one-time root workaround.
- You only want to verify ownership or permissions: use
ls -ldorstatfirst.
Troubleshooting checklist
If access fails, go through this checklist:
- Confirm the username and path are correct.
- Run
ls -ld /home /home/usernameto check ownership and modes. - Make sure you are using
sudowhen necessary. - Check whether the parent directory blocks traversal.
- Look for ACLs with
getfaclif your system uses them. - Confirm the file exists before assuming it is a permissions issue.
If you see No such file or directory, the path may be wrong or the user may not have a standard home folder. If you see Permission denied, the directory permissions or security policy are the more likely cause.
Best practices
- Use the smallest privilege needed for the task.
- Prefer one-off commands with
sudoover broad root sessions when possible. - Do not change ownership unless you truly need to transfer control of the files.
- Use shared groups or ACLs for recurring collaboration.
- Be careful with private files such as SSH keys, tokens, and shell history.
Frequently Asked Questions About how to access other user home directory linux
How can I access another user’s home directory in Linux?
The usual method is to use sudo or a root shell. Without elevated privileges, access depends on the directory permissions, group membership, or ACLs.
Why do I get Permission denied when entering another user’s home folder?
That usually means the directory is private, or one of the parent directories does not allow traversal. Check ownership and permissions with ls -ld.
Can I use sudo to view files in another user’s home directory?
Yes. Commands like sudo ls, sudo cat, and sudo less are common and safer than changing ownership.
What is the safest way to let one user access another user’s files?
Use a shared group directory or an ACL when the access needs to be ongoing. That is usually safer than making a personal home directory broadly readable.
How do I check permissions on a Linux home directory?
Use ls -ld /home/username for a quick check, or stat /home/username for more detail. Also check the parent directory, usually /home.
Do I need root to access another user’s home directory?
Not always, but root access is the most reliable way if the directory is private. If permissions already allow access, root is not required.
Conclusion
The practical answer to how to access other user home directory linux is usually to use sudo or root privileges, because ordinary users cannot browse private home directories by default. If access fails, inspect permissions on both the target directory and its parent, then choose the least invasive method that fits the job. For repeated collaboration, shared groups or ACLs are usually better than direct root access.
