You are not logged in.
I accidently reset my home permissions. Now, I can't get into my home directory except as root. What command can I do to make every file in my home to be read/write accesable ONLY to punkrockguy and root?
If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing. 1 Corinthians 13:2
Offline
This is kinda important! I need to work on this machine! Thanks in advance!
If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing. 1 Corinthians 13:2
Offline
Set ownership to you, this command is recursive for all files in the directory too:
chown -R <i>{username}</i>:users /home/<i>{username}</i>
Set the directory to be at least accessible by the owner:
chmod o+rx /home/<i>{username}</i>
See the man pages for more details about the commands.
http://themanaworld.org/
A Free Real-time Massively Multiplayer Online RPG in development.
Offline
I executed the command, and I'm still getting permission denied...
If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing. 1 Corinthians 13:2
Offline
My username is punkrockguy318 by the way
If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing. 1 Corinthians 13:2
Offline
Yeah well, you need to replace the "username" with whatever your username is... I've edited it to reflect this a bit.
http://themanaworld.org/
A Free Real-time Massively Multiplayer Online RPG in development.
Offline
Okay, yeah that's what I did. No cigar, It says Permission denied!
If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing. 1 Corinthians 13:2
Offline
Hmm, maybe the fact that I messed up the second command is causing troubles, seems weird though...
chmod u+rx /home/<i>{username}</i>
That's u (user) instead of o (others).
http://themanaworld.org/
A Free Real-time Massively Multiplayer Online RPG in development.
Offline
Hmm.. It seems like I need execute permissions to access directories... I can get everything to work my
chmod -R u+rwx /home/punkrockguy318
But I don't want everything executable! How can I make everything except directories notexecutable?
If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing. 1 Corinthians 13:2
Offline
Hmm, I had hoped the chmod didn't need to be applied recursive. You can try to use the 'find' command to make all files non-executable. From your home directory, run something like:
find -type f -exec chmod a-x "{}" ";"
See the find manpage for more details.
Of course you'll need to add the executable flag the files files you DO want to be executable, like the ones in your ~/bin and stuff called 'configure' and such.
http://themanaworld.org/
A Free Real-time Massively Multiplayer Online RPG in development.
Offline
Hmm... It says missing arguement to exec... I haven't used find before... I'm looking at the manpage, and I don't see anything wrong with the command. What could it be?
If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing. 1 Corinthians 13:2
Offline
You can also try
find ~/ -type f |xargs chmod 0644
Offline
Hmm, I tried the find command like that and it seemed to be working just fine. xargs should do the job too though.
The missing argument to -exec could be because the ; is not properly recognized, the man page mentions quoting or escaping, and you should also not forget the spaces and such. It's tricky to get it right.
http://themanaworld.org/
A Free Real-time Massively Multiplayer Online RPG in development.
Offline
find -type f -exec chmod a-x "{}" ;
I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal
Offline
Sweet, got it working! Thanks a lot guys! So I guess it's true you need the X permission to open directories?
If I have the gift of prophecy and can fathom all mysteries and all knowledge, and if I have a faith that can move mountains, but have not love, I am nothing. 1 Corinthians 13:2
Offline
That's certainly the case. The read permission is just to be able to see the listing of the files inside the directory I think.
http://themanaworld.org/
A Free Real-time Massively Multiplayer Online RPG in development.
Offline