1849379 Members
6656 Online
104044 Solutions
New Discussion

Change mode

 
SOLVED
Go to solution
Cheung_2
Frequent Advisor

Change mode

How to change the mode of file from
"-r--r--r--" to "-r--r-Sr--" ? Thx.
Andy
11 REPLIES 11
Michael Tully
Honored Contributor

Re: Change mode

Try:

# chmod 2444 filename
Anyone for a Mutiny ?
Rajeev  Shukla
Honored Contributor

Re: Change mode

you can do
chmod g+s file
or
chmod 2444 file


Rajeev
Cheung_2
Frequent Advisor

Re: Change mode

sorry, the new chmod should be "-rwsr-xr-x" , how to change to it? thx.
Andy
Sridhar Bhaskarla
Honored Contributor

Re: Change mode

Just in case if you change the permissions of the file to execute later, it is going to appear as small "s".

Capital "S" indicates setuid/gid bit without execute permission and lowercase "s" indicates setgid with execute permissions.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Sridhar Bhaskarla
Honored Contributor

Re: Change mode

It is going to be

chmod 4755 your_file

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Michael Tully
Honored Contributor

Re: Change mode

Try:

# chmod 4755 filename



I don't like to play points policeman, but please be sure to allocate points to the people who assist you. They do so using their own time and resources.
Anyone for a Mutiny ?
Rajeev  Shukla
Honored Contributor

Re: Change mode

Try this out
chmod 4755 file

Rajeev
Rajeev  Shukla
Honored Contributor

Re: Change mode

I fully agree with you Michael
T G Manikandan
Honored Contributor

Re: Change mode

rwsr-xr-x to get this you can do
#chmod u=rwxs,g=rx,o=rx


John Collier
Esteemed Contributor

Re: Change mode

Michael,

I normally wouldn't chime in on something like this, but since I just looked at Andy's (Cheung's) stats and found that he has only given points to 5/100 responses to his questions, I think an explanation of the point relavence thing might be in order.

Since you seem to hold a much higher standing in the forum than I, would you do the honors?
"I expect to pass through this world but once. Any good, therefore, that I can do, or any kindness that I can show to any human being, let me do it now. Let me not defer or neglect it, for I shall not pass this way again." Stephen Krebbet, 1793-1855
Shannon Petry
Honored Contributor
Solution

Re: Change mode

Buy a book on basic Unix adminstration, or read the man pages for chmod.

man

will generally give you more information than you will know what to do with.


man is your friend, use it!

Regards,
Shannon
Microsoft. When do you want a virus today?