Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am having issued with drive permissions on Ubuntu 12.10. The server to which I'm connecting over ssh has two HDDs. Ubuntu runs off 'Drive 1', and the server app runs 'Drive 2'. When I formatted Drive 2 to ext4, I had to manually add the permissions for my user account to be able to read/write to it. This process went smoothly, and, when directly using the computer (in GUI mode), I can access the drive without any issues.

However, when I log in to the machine remotely via ssh, under the same user account, when I try to access Drive 2 (actually called LinuxDataDrive) (using cd command), I get the message:

bash: cd: LinuxDataDrive/: Permission denied

Why is this? I logged into ssh using the same (and only) user account, and on that same account, using the machine itself, I can access the drive without issue.

Any suggestions?

Thanks in advance!

Over ssh:


uid=1000(karl) gid=1000(karl) groups=1000(karl),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),107(lpadmin),124(sambashare)



ls -ld LinuxDataDrive:

drwx------ 2 root root 4096 Apr 11 22:54 LinuxDataDrive – 


drwx------ 2 root root 4096 Apr 11 22:54 LinuxDataDrive
karl@KarlsMinecraftServer:/media/karl$ df
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sdb5       49060680 6194752  40373720  14% /
udev             4016332       4   4016328   1% /dev
tmpfs            1611896     808   1611088   1% /run
none                5120       0      5120   0% /run/lock
none             4029732       0   4029732   0% /run/shm
none              102400       4    102396   1% /run/user

karl is the username

KarlsMinecraftServer is the machine name

LinuxDataDrive is the actual name of the 'Drive2' referenced in the question.

share|improve this question
Can you print the output of the id command, both from the shell when the access is working, and from the one where it doesn't? Also the outputs of the pwd command and ls -ld Drive2. In other words 1) who you are, 2) where you are and 3) what it is you're accessing. In addition, the output of df, which shows your storage landscape concisely. –  Kaz Apr 12 '13 at 4:22
You should put this in the question, and format it better. If you put four spaces at the beginning of a line it becomes formatted as mono-spaced tty output, suitable for showing code and sample output. –  Kaz Apr 12 '13 at 6:45
Ha okay, this is my first time using this site. –  Karl Kalina Apr 12 '13 at 6:47
I don't understand how ls -ld Drive2 shows a listing for the entry LinuxDataDrive. Because if Drive2 is a symlink, then ls -ld will show the symlink, not the target. But in any case, LinuxDataDrive is owned by root, and absolutely not accessible in any way by other users. –  Kaz Apr 12 '13 at 6:47
I don't understand this bit logged into ssh using the same (and only) user account, and on that same account, using the machine itself, I can access the drive without issue.. You mean if you ssh to localhost FROM the machine it works? Or do you mean when you just log into your machine (so no ssh)? –  Nanne Apr 12 '13 at 6:56

1 Answer 1

Just a hypothesis:

This looks a lot like some auto-mounting software behaving differently based on how you log in. The output of df shows that you have nothing mounted besides the root partition on /dev/sdb5. There is no listing for any mounted filesystem under /media. So when you're in /media/{yourusername}, this LinuxDataDrive subdirectory is just a regular directory, probably intended to be the mount point for the drive. The mount point is owned by root and inaccessible, so you get a permission error.

When the real LinuxDataDrive is mounted, then the permissions change: the mounted filesystem hides the mountpoint, and imposes its own persmissions.

Try doing something like mount /media/{yourusername}/LinuxDataDrive. If that appears successful, try to access that directory again.

share|improve this answer
Okay, thanks, I see what you're saying. However, when I use the command mount /media/LinuxDataDrive, I get the error: mount: can't find /media/LinuxDataDrive in /etc/fstab or /etc/mtab –  Karl Kalina Apr 12 '13 at 7:14
How about mount /media/{yourusername}/LinuxDataDrive ? –  Kaz Apr 12 '13 at 7:17
Oops, my bad. However, I still get the same error, save for the updated path. –  Karl Kalina Apr 12 '13 at 7:19
Okay, well that is then some auto-mounting software (perhaps tied to the Ubuntu desktop) that I don't have experience with, which doesn't use static entries in /etc/fstab. Sorry! But at least it is safe to say that your drive isn't mounted. Do the same commands from the local machine when the access works and you will see that LinuxDataDrive has different permissions, and shows up in df. I'm out; good night and good luck with that, Karl. –  Kaz Apr 12 '13 at 7:21
Okay, thanks a ton for all the insight! –  Karl Kalina Apr 12 '13 at 7:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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