Forum Moderators: phranque

Message Too Old, No Replies

UNIX CHMOD question

How to change -r--r--r--

         

carfac

1:08 am on Sep 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi:

Had a melt down last night- I do not know why. Looks like something in perl got screwed up or something.... I don't know. All I know is the site works, but the perl does not. Tried to reinstall perl, but somehow a couple of the files are -r--r--r-- and cannot be over written, so install dumps. I have tried manually chmod 755 the file, but it says I do not have permisision. I am ssh/telented in as SU, so I thought I could change that... but I can't!

Is there some way I can get something changed, or what am I doing wrong?

Thanks!

Dave

bird

1:51 am on Sep 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need to be logged in as the owner of the files in question. On my system, root can chmod other peoples files as well, but I'm not sure if this is necessarily always the case.

carfac

1:54 am on Sep 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The files are owned by root... and I am beginning to think that as long as I am telnetting in, I can be a superuser, but not root.... so I can't change them without being at the box itself...

Sound right? Or can I make my SU account root?

dave

Lisa

2:12 am on Sep 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You will need to be root to change the files permissions. But you do not need to be at the consol to do this. As long as you have the root password and your hosting provider allows you to be root. Most providers will not. You would need to have a Virtual Dedicated Server or a Full Dedicated. But Virtual Dedicated Servers are cheaper and can give you root access.

It sounds like to fix this one issue you just need to email your hosting provider and they can do it for you.

carfac

2:19 am on Sep 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Lisa:

It is my own co-lo box...

So I SHOULD be able to do what I want, I just do not know if I have it configured right.

The file I need to change (so perl can overwrite) is owned by root:wheel When I log on, I get the regular prompt, I enter su and a password, and I get the # prompt. Does that make me root?

I can change all the other files (also root:wheel) in that directory except two... of cousre, the two I need to overwrite!

dave

carfac

2:19 am on Sep 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Lisa:

Or do I actually need to log on as "root"?

dave

bird

2:36 am on Sep 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, you need to be logged in as "root" in this case.

The confusion originates from the "su" (Switch User) command, which is most often used to change your current identity from a normal user to root. But an actual user named "su" is very uncommon, and may or may not have full root priviledges.

Lisa

2:52 am on Sep 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try "su - root" or just "su -",

They # prompt usually means you are root. But check what home directory you are in.

carfac

3:13 am on Sep 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Boy, am I screwed up! I changed the password on root, just to check... telneted in, then ran su and used the new password- no problem, logged in.

One file that was read only I got chmodded to 755, but the other returns :

chmod: lib/libc.so.4: Operation not permitted
chmod: lib/libc_r.so.4: Operation not permitted

carfac

3:15 am on Sep 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Lisa:

Did not see your post when I posted... I checked, I am in the directory root!

dave

Lisa

3:20 am on Sep 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have never heard of the root user not being able to change the file permissions unless the volume is write-protected. This one has me stumped.

carfac

3:54 am on Sep 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Lisa:

OK, that makes me feel a little better! At least I am just not doing something stupid!

dave

carfac

4:45 pm on Sep 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK, I found the problem... just, now, how to solve it!

I ran ls -lo, and found out these files have a "schg" flag associated with them. So I ran:

chflags noschg filename

but it does not allow the operation....

dave