You are not logged in.
Pages: 1
I have used chmod many times before, but now that I'm running my own machine it is giving me problems.
I created a user blake.
I run:
chmod -R u+w /home/blake/*
But when I am logged in as blake !root...I still cant write files my home directory.
Last edited by Blake Gideon (2009-09-17 03:42:58)
Offline
Is the owning user actually "blake"?
Did you chmod /home/blake itself as well as the stuff in it?
Do "ls -ld /home/blake".
Offline
Can this help me determine if I am in the users group?
bash-4.0# apropos group | grep getgrouplist
getgrouplist (3) - get list of groups to which a user belongs
I dont know how to execute getgrouplist
EDIT:
bash-4.0# ls -ld /home/blake/
drwx------ 11 blake blake 4096 2009-09-16 22:03 /home/blake/
Last edited by Blake Gideon (2009-09-16 22:11:27)
Offline
Is your /home on a seperate partition? If so, do you give users write permission when you mount it?
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
A "dirty" fix:
Create a script:
#!/bin/bash
auser=$1
chown -R "$auser":"$auser" "$auser"
find "$auser" -type d -exec chmod 755 {} ;
find "$auser" ! -type d -exec chmod 644 {} ;
and run it (be root) as "<script> blake"
Offline
rson451 - Yes it is on a different partition.
I dont know where mounting is taking place. Is this something I should put in rc.conf?
flamelab, I am not gonna run a script, when I dont understand how its working.
Last edited by Blake Gideon (2009-09-16 22:16:02)
Offline
I cant even
chmod u+w /home
as root
Offline
A "dirty" fix:
Create a script:
#!/bin/bash auser=$1 chown -R "$auser":"$auser" "$auser" find "$auser" -type d -exec chmod 755 {} ; find "$auser" ! -type d -exec chmod 644 {} ;
and run it (be root) as "<script> blake"
This does the same as:
chmod -R u=rwX,go= /home/blake/
Note the capital X. This one also doesn't remove execute from any scripts etc that need execute permissions.
Blake Gideon -> The script above is safe, it is:
1) recursively setting ownership to your user
2) finding all directories and making them rwxr-x-r-x permissions
3) finding all other files and making them rw-r--r-- permissions
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
I ran
chmod -R u=rwX /home/blake/
but still did not assign any permissions to the user:
drwx------ 11 blake blake 4096 2009-09-16 22:03 blake
EDIT:
This is quite an inconvienece for me, as I'm trying to keep the root filesystem clean. I need to be able to write files in my user ~/ asap. Any help is greatly appreciated
Last edited by Blake Gideon (2009-09-16 22:33:52)
Offline
but still did not assign any permissions to the user:
drwx------ 11 blake blake 4096 2009-09-16 22:03 blake
That is rxw permissions for the user so I'm not sure what you mean...
Post the output of:
mount
ls -ln /home
ls -ln /home/blake/ | head
id blake
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
bash-4.0# mount
/dev/sda3 on / type ext3 (rw)
none on /dev type tmpfs (rw,relatime,mode=755)
none on /proc type proc (rw,relatime)
none on /sys type sysfs (rw,relatime)
none on /dev/pts type devpts (rw)
none on /dev/shm type tmpfs (rw)
/dev/sda4 on /home type ext3 (rw)
bash-4.0# ls -ln /home
total 24
drwx------ 15 1000 100 4096 2009-09-15 20:42 bjg
drwx------ 11 1001 1001 4096 2009-09-16 22:03 blake
drwx------ 2 0 0 16384 2009-09-15 00:28 lost+found
bash-4.0# ls -ln /home/blake | head
total 5844
drwxr-xr-x 2 0 0 4096 2009-09-16 20:20 Applications
drwxr-xr-x 3 0 0 4096 2009-09-16 19:44 Desktop
drwxr-xr-x 2 1001 1001 4096 2009-09-16 02:59 Downloads
drwxr-xr-x 2 0 0 4096 2009-09-16 22:02 Perl
drwxr-xr-x 2 1001 1001 4096 2009-09-16 06:31 Scripts
-rw-r--r-- 1 0 0 5949333 2009-09-16 20:54 sys
bash-4.0# id blake
uid=1001(blake) gid=1001(blake) groups=1001(blake),7(lp),10(wheel),91(video),92(audio),93(optical),95(storage),98(power),100(users)
Offline
I still cant get write permissions:
bash-4.0# chmod -R u=rwX blake
bash-4.0# ls -lh /home/blake
total 5.8M
drwxr-xr-x 2 root root 4.0K 2009-09-16 20:20 Applications
drwxr-xr-x 3 root root 4.0K 2009-09-16 19:44 Desktop
drwxr-xr-x 2 blake blake 4.0K 2009-09-16 02:59 Downloads
drwxr-xr-x 2 root root 4.0K 2009-09-16 22:02 Perl
drwxr-xr-x 2 blake blake 4.0K 2009-09-16 06:31 Scripts
-rw-r--r-- 1 root root 5.7M 2009-09-16 20:54 sys
Last edited by Blake Gideon (2009-09-16 23:13:16)
Offline
Post the output of `cat /etc/fstab`
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
bash-4.0# cat /etc/fstab
#
# /etc/fstab: static file system information
#
# <file system> <dir> <type> <options> <dump> <pass>
none /dev/pts devpts defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/cdrom /media/cd auto ro,user,noauto,unhide 0 0
/dev/dvd /media/dvd auto ro,user,noauto,unhide 0 0
#/dev/fd0 /media/fl auto user,noauto 0 0
#/dev/sda1 /boot ext2 defaults 0 1
/dev/sda2 swap swap defaults 0 0
/dev/sda3 / ext3 defaults 0 1
/dev/sda4 /home ext3 defaults 0 1
Offline
I guess what you need more urgently is a chown rather than a chmod... Preferrably a recursive one. Ls by default shows a bit but not everything, there's probably tons of hidden dirs in your homedir you don't see the permissions of, and to which a lot of applications will want to write.
Looks to me like you've been screwing around as root in your user's homedir .
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
I followed the instructions for creating a user by the book. I really dont know what is going on.
EDIT: I want to get this all set up right so I can "screw around" under a user account and not as root.
Last edited by Blake Gideon (2009-09-17 00:40:26)
Offline
bash-4.0# chmod -R u=rwX blake bash-4.0# ls -lh /home/blake total 5.8M drwxr-xr-x 2 root root 4.0K 2009-09-16 20:20 Applications drwxr-xr-x 3 root root 4.0K 2009-09-16 19:44 Desktop drwxr-xr-x 2 blake blake 4.0K 2009-09-16 02:59 Downloads drwxr-xr-x 2 root root 4.0K 2009-09-16 22:02 Perl drwxr-xr-x 2 blake blake 4.0K 2009-09-16 06:31 Scripts -rw-r--r-- 1 root root 5.7M 2009-09-16 20:54 sys
A lot of those dirs, and probably files, are owned by root. This should fix it:
chown -R blake:blake /home/blake
You've been setting the permissions correctly all along, but the ownership was wrong.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
A lot of those dirs, and probably files, are owned by root. This should fix it:
chown -R blake:blake /home/blake
You've been setting the permissions correctly all along, but the ownership was wrong.
I was gonna say, why not try chown -R... seems like the main issue
"I know what you're thinking, 'cause right now I'm thinking the same thing. Actually, I've been thinking it ever since I got here:
Why oh why didn't I take the BLUE pill?"
Offline
chown did not reem to do anything:
bash-4.0# chown -R blake:blake ./blake/
bash-4.0# ls -ln
total 24
drwx------ 15 1000 100 4096 2009-09-15 20:42 bjg
drwx------ 11 1001 1001 4096 2009-09-16 22:03 blake
drwx------ 2 0 0 16384 2009-09-15 00:28 lost+found
bash-4.0# su blake
[blake@HP4510 home]$ ls -l
total 24
drwx------ 15 bjg users 4096 2009-09-15 20:42 bjg
drwx------ 11 blake blake 4096 2009-09-16 22:03 blake
drwx------ 2 root root 16384 2009-09-15 00:28 lost+found
Offline
You still havent told us _where_ you issue your commands from and postings further up - you change permissions in everything _inside_ /home/blake but not /home/blake itself!
As root do:
chown -R blake:blake /home/blake
You may also have to do a:
chmod a+rwx /home
Offline
chown did not reem to do anything:
Post the output of this:
cd /home/blake
chown -R blake:blake .
ls -ln
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
chmod is now working on /home. I was always running commands as root. I guess I was having problems because i was trying to do recursive chmod's on directories beneath /home. Now I just have to figure out what the permissions should be.
Offline
I guess I was having problems because i was trying to do recursive chmod's on directories beneath /home.
That shouldn't be a problem unless something is srsly fsck'ed up.
This is why we avoid working as root unless we *have* to
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Do you suggest reinstalling? Is there something wrong with the way my partitions are set up? The wiki and beginners guide seem to be written for an older install as far as partition set up goes. Does my partitions table look normal? What is wrong with it?
bash-4.0# cat /etc/fstab
#
# /etc/fstab: static file system information
#
# <file system> <dir> <type> <options> <dump> <pass>
none /dev/pts devpts defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/cdrom /media/cd auto ro,user,noauto,unhide 0 0
/dev/dvd /media/dvd auto ro,user,noauto,unhide 0 0
#/dev/fd0 /media/fl auto user,noauto 0 0
#/dev/sda1 /boot ext2 defaults 0 1
/dev/sda2 swap swap defaults 0 0
/dev/sda3 / ext3 defaults 0 1
/dev/sda4 /home ext3 defaults 0 1
Offline
Your partitioning looks fine. I think it was just a problem with mixing working at root and working as your normal user which screwed up some of the ownerships on various files / directories.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Pages: 1