LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-24-2006, 01:02 PM   #1
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Rep: Reputation: 45
Problem changing file permisions


Check the following text from terminal
akroneiro:/home/alaios # ll -d ./Documents/
drwxr-xr-x 26 root root 16384 1970-01-01 02:00 ./Documents/
akroneiro:/home/alaios # chown alaios ./Documents/
chown: changing ownership of `./Documents/': Operation not permitted



Why root can change the permission?
 
Old 01-24-2006, 02:16 PM   #2
m_yates
Senior Member
 
Registered: Aug 2003
Location: Upstate
Distribution: Debian, Mint, Mythbuntu
Posts: 1,249

Rep: Reputation: 101Reputation: 101
If the owner is root, then only root can change the ownership to somebody else.
 
Old 01-24-2006, 02:31 PM   #3
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
Thx but as u can see in the second command root executes...
 
Old 01-24-2006, 02:52 PM   #4
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
You're sure you're root? A "#" in the prompt usually indicates root, but doesn't prove it. Any user can change their PS1 string to include a "#". Normal users can't do a chown, at least not on my Debian Sid or Sarge installations. Normal users get the exact same error message you are reporting. chown by a normal user works fine on a Solaris box however. Different OS though.

If you really are root, what filesystem type are you using? Is the filesystem mounted as read-write or read-only?
 
Old 01-24-2006, 04:53 PM   #5
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
It looks like the error you sometimes get when changing permission on a fat32 file system. Is Documents mounted on a USB key from your home directory or something like that?
 
Old 01-25-2006, 02:49 AM   #6
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
Yea u are right .. i am so stupid thats a fat 32 partition.. but still i want not only mount my partition but also i want to create folders etc..Suggestions?
 
Old 01-25-2006, 04:36 AM   #7
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Have a look in /etc/fstab where the mount options for the partition are listed. You'll probably need the umask and/or uid options added. With a umask of 000, there should be no unlimited access, you could also use uid=500 (for example - use whatever your uid from /etc/passwd is).
 
Old 01-25-2006, 05:04 AM   #8
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
Thats the line
/dev/hda5 /home/alaios/Documents vfat user,uid=1000 0 0
 
Old 01-25-2006, 12:28 PM   #9
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
OK, if you run the following (and substitute your username), you'll get the correct uid to use:

Code:
grep username /etc/passwd | cut -d: -f3
That may return something like 1001. And if you use the following to get your group id:

Code:
grep '^username' /etc/group | cut -d: -f3
That may return something like 102. The least restrictive options to use will be:

Code:
/dev/hda5  /home/alaios/Documents  vfat rw,user,uid=1001,gid=102,umask=000  0 0
Read/write access is normally the default - but I've added it just be safe. Running the mount command should show something like:

Code:
/dev/hda5 on /home/alaios/Documents type vfat (rw,uid=1001,gid=102,umask=000)
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
howto chowto change file permisions in multiplhange file permisions in multiple dirs? pingvina Linux - Software 3 01-13-2006 03:10 PM
file permisions citrus Linux - Newbie 1 01-04-2006 05:06 AM
New to redhat. need help with changing folder permisions vinpor Linux - Software 3 05-09-2004 06:08 AM
looking up file permisions starwind Linux - Newbie 1 10-15-2003 07:33 PM
Changing kppp permisions Glock Shooter Linux - Newbie 4 10-02-2002 01:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:51 AM.

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