Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Changing the user id or euid of the shell itself Post 302528954 by Perderabo on Wednesday 8th of June 2011 09:37:44 AM
Old 06-08-2011
The guy that wrote the shell determines what system calls it invokes. It would be possible for the shell's author to give the shell's user access to any system call. Perl pretty much does this, but perl is not exactly a shell. But even if you wrote your own C program, you can't just change the euid of your own process... that would be terrible for security. The system calls that fiddle with the uid's only work as root. So the login process, which runs as root, can switch to your uid and then exec a shell. But you cannot switch back to root.

You can run an suid program like passwd to temporarily gain some limited root power. See: https://www.unix.com/tips-tutorials/1...rmissions.html for details on that.
 

10 More Discussions You Might Find Interesting

1. Cybersecurity

Changing effective user

I would like to give execution rights for a script to one user. (that's the easy part...) When that user is running the script, I would like the effective user ID to be that of the file-owner. Is this possible? (6 Replies)
Discussion started by: hilmel
6 Replies

2. UNIX for Advanced & Expert Users

Changing permissions of a user

So I need to change the permissions of my user account. I can access the root account on the server, but don't know how to change the permissions of my user account. I was advised to try 'userconf' to see if I am part of a group, but I dunno how that works. ANyone who knows how to see the... (3 Replies)
Discussion started by: achink125
3 Replies

3. AIX

changing user password

I have 02 servers: - Linux RHEL AS 3 (server1) - AIX 5.2 (server2) Running the command rsh server2 passwd derje from the server1 to change derje user password on server2, give me this error: 3004-709 Error while changing the password for "derje" Can somebody help me ? (0 Replies)
Discussion started by: mayge
0 Replies

4. UNIX for Dummies Questions & Answers

To:blowtorch - Setuid uid/euid issue

Hi, Its a shell script. rws by root, r_s by group named "other" and r_x by all others. How can i set the uid from inside a setuid program. please let me know. Also I dont have a c compiler on the system. Thanks Reply With Quote (0 Replies)
Discussion started by: 0ktalmagik
0 Replies

5. Solaris

EUID set for all non-root users

We have a Solaris box. I noticed that whenever any non-root user logins into the box and issues the command id the output is (for example) uid=42568(sam) gid=1245(sam) euid=0(root) egid=2(bin). I have not given any privileges to anyone explicitly. When I issued ls -l in the /usr/bin directory I... (1 Reply)
Discussion started by: chrisanto_2000
1 Replies

6. Red Hat

euid and egid frpm proc

hi, can anyone tell me where can i find euid and egid from /proc file system in RHEL 4? i read stat file, but i got only uid and gid, and cudnot find any entry regarding euid and egid.please suggest... thanks, sanjay (2 Replies)
Discussion started by: sanjaykhuntia
2 Replies

7. AIX

Changing User Characteristics

We use smitty to administer user accounts. Is it safe to make changes to the characteristics of a user while the user is logged in? Can I set "Is this user ACCOUNT LOCKED?" to true ? Can I set an expiration date on an account? Will this effect the user in anyway during their current... (1 Reply)
Discussion started by: andrewsc
1 Replies

8. Solaris

rbac and execution attributes (uid and euid)

Hi all, I have a question to see if I understand the euid and uid attributes correctly for rbac (/etc/security/exec_attr): All: * Audit Control: /etc/init.d/audit euid=0, egid=3 /etc/security/bsmconv uid=0 /etc/security/bsmunconv uid=0 /usr/sbin/audit euid=0 /usr/sbin/auditconfig... (6 Replies)
Discussion started by: deadeyes
6 Replies

9. AIX

AIX How to run a Shell Script by changing the User

Hi All, Currently our application is running on the server having AIX 5.3 OS. What we intend to do is to run a shell script owned by another user and needs to be run as that particular user. I was trying to create a shell script using the su command before running the actual script (which... (4 Replies)
Discussion started by: acoomer
4 Replies

10. Shell Programming and Scripting

User id who is changing the script.

can we know the user id who changed saved script in cron tab..:D (7 Replies)
Discussion started by: netdbaind
7 Replies
CHROOT(8)						    BSD System Manager's Manual 						 CHROOT(8)

NAME
chroot -- change root directory SYNOPSIS
chroot [-G group,group,...] [-g group] [-u user] newroot [command] DESCRIPTION
The chroot command changes its root directory to the supplied directory newroot and exec's command, or, if not supplied, an interactive copy of your shell. If the -u, -g, or -G options are given, the user, group, and group list of the process are set to these values after the chroot has taken place; see setgid(2), setgroups(2), setuid(2), getgrnam(3), and getpwnam(3). Note: command or the shell are run as your real-user-id. ENVIRONMENT
The following environment variable is referenced by chroot: SHELL If set, the string specified by SHELL is interpreted as the name of the shell to exec. If the variable SHELL is not set, /bin/sh is used. SEE ALSO
ldd(1), chdir(2), chroot(2), environ(7) HISTORY
The chroot utility first appeared in 4.4BSD. SECURITY CONSIDERATIONS
chroot should never be installed setuid root, as it would then be possible to exploit the program to gain root privileges. BSD
August 13, 2011 BSD
All times are GMT -4. The time now is 02:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy