Wednesday, August 17, 2005

su - leaves me as myself, not root

su - leaves me as myself, not root

This quirk just started about a week ago. Never had a problem before.

As a normal user I cannot become the root user:

$ uname -a
SunOS ultra 5.6 Generic_105181-15 sun4u sparc SUNW,Ultra-1
$ id
uid=1000(roger) gid=10(staff)
$ su -
Password: [enter in root's password]
Sun Microsystems Inc. SunOS 5.6 Generic August 1997
$ id
uid=1000(roger) gid=10(staff)
$ echo hello >> /junk
/junk: cannot create
$

But this works:

$ id
uid=1000(roger) gid=10(staff)
$ su
Password: [enter in root's password]
# id
uid=0(root) gid=1(other)
# echo hello > /junk
# cat /junk
hello
# rm /junk
# exit
$ id
uid=1000(roger) gid=10(staff)
$

Suggestions?

Reply


John Howells Aug 16, 2:33 am show options
N
> Suggestions?

Presumably if you "echo $$" you are in the same shell for the "su -" case? The
difference between "su -" and "su" is that the environment is set up for the
former, so presumably something in root's .profile is terminating the su and
putting you back to the original shell. Try renaming root's .profile (and any
other startup stuff if you have changed root's shell from sh) and then see what
happens.

John Howells

0 Comments:

Post a Comment

<< Home