what is "S" instead of "X" in the file permission when i look at /usr/bin/chsh?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
what is "S" instead of "X" in the file permission when i look at /usr/bin/chsh?
I was looking at program /usr/bin/chsh, and found that the word "S" instead of "X" on the permission :
-RWS--X--X
Wondering, what was this "S"?
Also, i was practising a few command: I got a root user, and two general users which i created, ie. player1 and player2, both in the same group.
Now, i want to make player1 as the root person too, that is a superuser, so i know the user id of the super user is 0. I was wanting to know the command for changing this? After this, i want to change again the uid and gid of player1 to that of player2. Please help me in my these three quries, as i am really new and fresh to Linux.
Awaiting reply from some one.
Cheers
Cherish
Click here to see the post LQ members have rated as the most helpful post in this thread.
s instead of x in the owner permissions means that the 'sticky bit' (suid) is enabled, so this file will be executed with root permissions by all users...
Actually, the setuid bit is not the same as the sticky bit. The sticky bit is a t instead of an x in the other permissions (e.g. for /tmp). The setuid bit is as or1onas says, while the sticky bit set on a directory implies users may only rm files in that directory if they own them (a handy thing for /tmp). On older Unices, the sticky bit caused the system to keep the program's text segment in memory, but on modern systems with modern memory handling this is no longer necessary.
chmod 4777 filename will change the mode to rwsrwxrwx You can run a simple find / -perm +4000 to get a list of all the suid files. You will notice a lot of network applications since root does all network related tasks.
chmod 2777 directoryname will set the sgid. If I have a dir named share and it is owned by root and owned by a group named buddies, then when the sgid bit is set on that directory, any file created or placed in that directory will be owned by the buddies group regardless of who put the file in there.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.