Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Removing Files Permissions

Removing Files Permissions
Thread Tools
Fresh-Faced Recruit
Join Date: Mar 2007
Status: Offline
Reply With Quote
Mar 8, 2007, 05:27 AM
 
My problem is I put file permissions on some files on desktop and /inputmanagers and I need to remove them but the rm command in single user mode gets denied.

I got the permissions commands from Rixstep
I ran these commands
mkdir /Library/InputManagers /Library/StartupItems
chmod 0700 /Library/InputManagers /Library/StartupItems
sudo chown 0:0 /Library/InputManagers /Library/StartupItems
sudo chflags 1600017 /Library/InputManagers /Library/StartupItems

and ran these commands also on two files on my desktop but i sudo chmod 0400 the files the followed by chown and chflags

running the command ls -adilo /users/whosthis/desktop/s.rtf

produced (same for both desktop files)
2974134 -rwx------ 1 root wheel sappnd,arch,schg,uappnd,uchg,nodump,opaque 321 Mar 2 15:03 /users/whosthis/desktop/s.rtf

anyone?
(yes I've learned my lesson )
     
Clinically Insane
Join Date: Oct 2000
Location: Los Angeles
Status: Online
Reply With Quote
Mar 8, 2007, 06:23 AM
 
I don't know, this may be one time in which it's actually appropriate to login as root if you cannot seem to accomplish the job with sudo.

"The natural progress of things is for liberty to yield and government to gain ground." TJ
     
Dedicated MacNNer
Join Date: Apr 2004
Status: Offline
Reply With Quote
Mar 8, 2007, 09:54 AM
 
that was a pretty stupid permissions change you made there. set it to be readable only by the owner, and then set the owner to someone else.

what you need to do is something like this:
sudo chown yourusername:yourusername ~/Desktop/s.rtf
sudo chmod 644 ~/Desktop/s.rtf

WHAT THIS DOES:
first command changes the owner of the file back to your user. It also (assuming you're running 10.3 or higher, sets the file's group appropriately as well. If you're on 10.2 or lower, it should be yourusername:admin or yourusername:staff (either should be OK))
second command changes file permissions of the file. File permissions include three bits: read, write, and execute. Read is 4, write is 2, execute is 1. each digit in the command specifies permissions for a certain user or set of users. First digit is owner permissions, second digit is group permissions, third is everyone else. Each digit is the sum of the permissions that user(s) should have. For example, the command that I've given set's owner's permissions to read/write, groups permissions to read only, and everyone else's permissions to read only. This is the standard permissions setting under OS X for new files.

Once you run those two commands, the files should be back to normal, and you should be able to do whatever you need to them (view, delete, etc.)
     
Grizzled Veteran
Join Date: Mar 2004
Status: Offline
Reply With Quote
Mar 8, 2007, 11:36 AM
 
Originally Posted by mr.dan.watson View Post
My problem is I put file permissions on some files on desktop and /inputmanagers and I need to remove them but the rm command in single user mode gets denied.

rm is for deleting files (not for unsetting flags or ownerships or permissions)

rm will not work until the sappnd and schg flags are unset (in SU mode!).
Let's simply unset all flags, with a zero:

chflags 0 /path/to/the/locked/item

Now you can do with it as you will.

Originally Posted by arcticmac View Post
that was a pretty stupid permissions change you made there.

The settings suggested in that article were purposeful.
How a user may decide to employ them, you can call what you like.
-HI-
     
Fresh-Faced Recruit
Join Date: Mar 2007
Status: Offline
Reply With Quote
Mar 8, 2007, 05:12 PM
 
chflags 0 /users/myname/desktop/s.rtf does not work
chown myname:myname /users/myname/desktop/s.rtf does not work
ive tried in single user mode and all I get is invalid argument or file system is read only

im ready to give up but ill wait another day to see what someone says or it
looks like I need to reformat(this sucks, ive never reformatted my mac once )
     
Posting Junkie
Join Date: Feb 2005
Location: 888500128
Status: Offline
Reply With Quote
Mar 9, 2007, 02:30 AM
 
sudo chflags 0 /users/myname/desktop/s.rtf
     
Fresh-Faced Recruit
Join Date: Mar 2007
Status: Offline
Reply With Quote
Mar 9, 2007, 05:28 AM
 
Originally Posted by analogika View Post
sudo chflags 0 /users/myname/desktop/s.rtf
At first I was like "Why is this being said again I already tried it with sudo"
So I went back into SU mode and tried again, still the same error "filesystem is read-only

Then it hit me... duh,, before is use that command I have to
sbin/mount /

then
sudo chflags 0 /users/myname/desktop/s.rtf


Everything is A ok now
Thank you all for your time I appreciate it.
(Last edited by mr.dan.watson; Mar 9, 2007 at 05:52 AM. )
     
Grizzled Veteran
Join Date: Mar 2004
Status: Offline
Reply With Quote
Mar 9, 2007, 05:25 PM
 
Originally Posted by analogika View Post
sudo chflags 0 /users/myname/desktop/s.rtf
The sappnd and schg flags can ***only*** be unset in Single User mode.

When running in Single User mode, sudo is pretty much unnecessary.
[Meaningless actually... since in SU mode there are no "other" users]


Originally Posted by mr.dan.watson View Post
sbin/mount /
The SU mode "splash screen" itself instructs the user: /sbin/mount -uw /
-HI-
     
   
Thread Tools
Forum Links
Forum 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
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:34 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2