 |
 |
Removing Files Permissions
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Mar 2007
Status:
Offline
|
|
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
|
|
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
|
|
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
|
|
Originally Posted by mr.dan.watson
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
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
|
|
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
|
|
sudo chflags 0 /users/myname/desktop/s.rtf
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Mar 2007
Status:
Offline
|
|
Originally Posted by analogika
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
|
|
Originally Posted by analogika
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
sbin/mount /
The SU mode "splash screen" itself instructs the user: /sbin/mount -uw /
|
|
-HI-
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|