Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 03-09-2007, 03:24 PM   #1
Registered: Mar 2007
Location: Prince George , BC, Canada
Distribution: RIght now, it's Slackware 11.0
Posts: 68

Rep: Reputation: 15
Accessing locked files from normal user

Hey guys, i'm useing slackware 11.0. I just installed last week, and I searched under permissions etc, couldn't find exactly what i needed.

I've got a 300gb external hard drive. I've mounted it, and it's showing up. I loged into the root accound and copied some files over onto my internal hard drive. I can access and view all my files just fine logged in as root in the KDE...but once I log into my normal user accound, the system:/media/sda2/usb is locked. To by pass this. I logged into my root accound, and copied the files over from my external directly onto my normal user accounts desktop. So I've got the folders containing all the files. I can go into the folders, but all documents, pictures, music, videos, everything has a lock over it. I also tried loging back in as root and then right clicking on the folder of the external hard drive, and changing the permission for groups and others to few & modify it. When i log back into my normal account, I can get in, but still can't open the files. I went back into root, and checked the "appply to all subfolders and files" and then my system went very slow..evenually coming up with an error. I can't think of anything else, got any idea's?
Old 03-09-2007, 03:26 PM   #2
Senior Member
Registered: Nov 2006
Distribution: Debian Squeeze SMP AMD64
Posts: 3,318

Rep: Reputation: 126Reputation: 126
sudo chown userid fileid


sudo chown -R userid directory

If you want to keep the owner as root, then you'll need to do a man on "chmod" to see which permissions you want to change.
Old 03-09-2007, 04:02 PM   #3
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Read the "man mount" manpage. Changing options in your mount command, you will be able to mount the usb partition with either full ownership ( I am assuming fat32 usb drive ) with the options uid=yourusername or with full access to everyone with umask=0000.

To change the permissions on the files in your home directory, since they were converted for many of them, you could use the find command to find files owned by root and use the option -exec chmod yourusername:yourgroupname '{}' \; to change each file found.
sudo find directory -user root -exec chmod username:username

If I misunderstood you post, and you had tried to change the permissions of the files and directories on the external drive, you can't do that for vfat and ntfs filesystems. You change permissions for the partition and it's contents with mount options. ( You probably didn't mean that anyway, I'm just covering all the bases. )
Old 03-13-2007, 05:13 AM   #4
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
I should have mentioned that for external drives it may be better to write a udev rule to run a hal helper program. This may depend on your distro. Some distro's don't have udev and some use hotplug instead of HAL.
Using "udevinfo -q all -n /dev/sda2" you can find a unique value to trigger the rule.

The problem is if you plug in another device, the device nodes may change. What was once /dev/sda2 may now be /dev/sdb3.

There was a post Saturday or Sunday referring to a howto on how to write the rule. Search this site for "hal" and "udev" and I'm sure you will find it.

If you always have the device plugged in, then it may not matter. In this case, use the "noauto" option anyway. Then if there is a problem with the external device, booting won't fail. Otherwise you will be dropped into the root shell, after entering the root password.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem accessing Gnome like normal user ArchArael Linux - Software 4 04-29-2005 10:50 AM
Windows files copied to my linux partition are locked when logged in as a normal user necbrownie Slackware 8 10-15-2004 08:11 AM
sometime kppp locked my keyboard on normal user demmylls Linux - General 2 12-26-2003 01:17 AM
newbie: accessing sr0 as normal user Arcades Slackware 6 07-09-2003 01:21 AM
normal user can't execute files in cd..? doublefailure Linux - Hardware 0 09-11-2002 01:04 AM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:42 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration