Operating System - HP-UX
1836407 Members
2538 Online
110100 Solutions
New Discussion

su to user without knowing the password

 
SOLVED
Go to solution
Petr Simik
Occasional Contributor

su to user without knowing the password

Can some ordinarry user SU to another user without knowing the password? (as root)
Can I setup (configure) some trustings?

7 REPLIES 7
Pete Randall
Outstanding Contributor

Re: su to user without knowing the password

AFAIK, only root is able to su to another user without providing the password - and I sincerely hope that no one proves me wrong.

Pete

Pete
steven Burgess_2
Honored Contributor

Re: su to user without knowing the password

Hi

I think your pretty safe with that reply Pete

Regs

Steve
take your time and think things through
Darren Prior
Honored Contributor

Re: su to user without knowing the password

The man page for su(1) backs you up Pete :)

"To use su, the appropriate password must be supplied unless the current user is superuser."

regards,

Darren.
Calm down. It's only ones and zeros...
Chris Wilshaw
Honored Contributor
Solution

Re: su to user without knowing the password

You should be able to do this using sudo

Download it from

http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/sudo-1.6.2b1/
Keith Clark
Valued Contributor

Re: su to user without knowing the password

This may work depending upon your requirements and a couple of dependancies. You can do it on the same machine or between machines. For this example I will use the same machine, called mymach and two users: user1 and user2 (how original!)

As user2, cd to your home directory and 'echo "mymach user1" >> .rhosts'

As long as remsh service is enabled and you can resolve mymach, you now should be able to execute as user1 'remsh mymach -l user2 '

It's not pretty, but it works.

Keith
Brian Kinney
Frequent Advisor

Re: su to user without knowing the password

su itself is quite secure. However, there are other tools which allow users to utilize other people's accounts.

.rhosts files are easy ways to bypass the passwd - if rsh,rlogin are on, you can act as another user as long as your ID is listed in the .rhosts file.

This is usually a security issue for a number of reasons:

1) poor syntax in the .rhosts file can lead to a server compromise. If Bob has a .rhosts file which says:

ralph bigserver
dave

Then ANY system which can answer as "bigserver" with a userid of "ralph" on it can gain access without a passwd. The "dave" entry is worse, as it doesn't care which server has a userid of "dave" it will have access.

This is how I accessed a server which lost the root passwd - through .rhost files. We saw the .rhosts file was readable for root, and saw a non-root user who was in the list. We logged into another UNIX host, su'd to that user, then used rlogin as root to access the locked out host, all without knowing the root passwd.

2) Daisychaining across hosts - Since many people use NFS to deliver /home/ , it will unwittingly give others inbound access to servers which the "account owner" never intended. For instance, Bob and Dave allow .rhosts between each other. Ralph convinces Bob that they should also share .rhosts. Bob has just given Ralph access to Dave's accounts.



"Any sufficiently advanced technology can be indistinguishable from magic" Arthur C. Clarke. My corollary - "Any advanced technology can be crushed with a sufficently large enough rock."
Sean OB_1
Honored Contributor

Re: su to user without knowing the password

Via regular su only superuser can switch to another user without the password.

If you use "sudo" then you can set it up to allow a particular user to su to another user, and they won't need the password.

sudo lets them run the su command as root.

http://www.courtesan.com for sudo.