[PLUG] Stupid newbie file permisions question

Jason R. Martin nsxfreddy at verizon.net
Wed May 18 04:34:43 UTC 2005


John Jason Jordan wrote:
> Today I must have typed su and my password at least a hundred times. I
> am told you're not supposed to log in as root, but this is getting
> seriously tedious. Today I needed to verify that files on an external
> USB hard disk were unaffected by the sudden demise of the hard disk in
> my Windows 2000 computer. "You don't have permission" is all I can get.
> Man, I bought that hard disk, I put the files on it, this computer
> should be smart enough to realize that. Getting pissed here.
> 
> I tried everything, but can't figure out how to give myself permission
> to see those files in the Nautilus file manager window. I typed su and
> my password in a command line, but Nautilus remains unimpressed.
> 
> OK, in Windows I am user jjj, but I am also the Administrator account.
> During Windows 2000 installation it creates the Administrator account
> and you have to create a password for it. Then you can create a user
> account to use for ordinary daily work. But when I created the jjj
> account I gave it administrator privileges. Now jjj can do anything on
> that machine that Administrator can do.
> 
> On this Linux machine I am root and I am also jjj. I just spent the past
> hour and a half reading about ACLs, but none of it made any sense to me.
> Plus finals are coming up in three weeks and I'm running out of time.
> How can I give jjj permanent root permission?

The *NIX Way is fundamentally different than the Redmond way, and it's 
not easy to change over.  Hang in there while you learn it!

Running su in a command prompt will only give that command prompt root 
priviliges.  Nautilus inherits it's privileges from the user you logged 
into X with, and since it's not a good idea to log into your X session 
as root (some distros won't even let you), it's better to investigate 
another method.

In this case your system sounds like it's mounting the USB mass storage 
device with root as the owner, and thus your user account doesn't have 
permission.  What distribution are you using?  I was under the 
impression that most of them granted permission to the console for 
automounted USBish devices now.

Anyway, try unmounting and remounting the USB device, this time 
specifying your username as the owner:

1) Open a root shell and type "mount", paying attention to where the USB 
mass storage device is mounted.  You want to know two things here, first 
the mount point (something like /mnt/usb, or /media/LEXAR), and second 
the device that is mounted there (something like /dev/sda1).
2) In the root shell type "umount /path/to/usb/device"
3) In the root shell type "mount -o uid=<your username> /dev/<device> 
/<mountpoint>"

Now you should have the USB device mounted on your system with your user 
as the owner of all the files.  Note that hotplug/automount/etc. 
probably won't handle unplugging the device once you've done this, so 
before you unplug it you should unmount it again.

Jason



More information about the PLUG mailing list