- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- setuid setgid ? pls Help
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2004 05:00 PM
тАО03-29-2004 05:00 PM
Why and What are setuid and setgid??? which command is used to set 'setuid' and 'setgid'
on a file.
B4 posting this question on forum, I tried to learn man pages, but didnt get the reason and usage of setuid and setgid, so Please Please TeAcH and/or ExPlaiN ... and if possible by ExamPleS
Second, i issue '$cat /etc/fstab' and found "none /dev/pts devpts gid=5,mode=620"
please also le me know whats 'gid=5' and 'mode=620' ?
Many Thanks In Advance
Best Regards,
Maaz
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2004 05:14 PM
тАО03-29-2004 05:14 PM
Solutionyou login using an account.
If you start a program it runs with that account, which means that (for exapmle) privileges to write to a file are based on your account.
If the program you run is 'setuid', it runs which the file-owner account. For example, the /usr/bin/passwd command is setuid root.
This means that if you run this program. you 'are' temporarily root. This means you can write to the /etc/passwd file (which is writable to root only).
setgid is the same, but for the group the file belongs to.
chmod 4750 file:
4 -> setuid
7 =4+2+1= r+w+x for user
5 =4+1 = r + x for group
0 = nothing for others
gid=5 -> group id = 5
grep :5: /etc/group tells it's the 'tty' group.
Mode 620: user read/write, group write, others nothing.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2004 06:10 PM
тАО03-29-2004 06:10 PM
Re: setuid setgid ? pls Help
but please also le me know how to set gid on a file ... chmod 4760 will sets suid not gid.
Second when I should set gid/suid on a file??? I mean when it is recommended or in which scenario one shold set suid/gid on a file
Maaz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-29-2004 06:38 PM
тАО03-29-2004 06:38 PM
Re: setuid setgid ? pls Help
1st: 4 = setuid, 2 = setgid, 1 = set sticky
2nd: (user) 4 = read, 2 = write, 1 = execute
3rd: (group) 4 = read, 2 = write, 1 = execute
4th: (other) 4 = read, 2 = write, 1 = execute
To set GUID on a file use one of the following:
chmod g+s file
or
chmod 2
This is all explained in the 'chmod' man page.
As for the 'fstab' entries, it's stating it wants that mount point (/dev/pts) to have group-id of 5, and all files under it (pts device nodes in this case) to have 620 permissions (-rw-w----).
.. oh, Jereon explained that already ..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2004 02:46 PM
тАО03-30-2004 02:46 PM
Re: setuid setgid ? pls Help
I do agree with u Stuart, i.e Jeroen Peereboom explained me so nice.
Regards
Maaz