Operating System - HP-UX
1835307 Members
2440 Online
110078 Solutions
New Discussion

switch user without giving a password

 
Mart van Loon
New Member

switch user without giving a password

Hi,
is it possible to switch to another user without giving a password? For su this is only for root
8 REPLIES 8
Peter Kloetgen
Esteemed Contributor

Re: switch user without giving a password

Hi Mart,

in my opinion only root is not asked to enter a password when doing a su. All other users have to enter a passwd no matter to which user they want to switch. ( as long as you don't create a second user with UID 0! )

Allways stay on the bright side of life!

Peter
I'm learning here as well as helping
Rich Wright
Trusted Contributor

Re: switch user without giving a password

Depending on what you want to do, you might want to look at Restricted Sam or sudo.
Sanjay_6
Honored Contributor

Re: switch user without giving a password

Hi,

If you are logged in as root, you can do a su to another system without giving a password. But if you are logged in as any other user (without superuser priviledges), you'll have to supply a password while doing an su to another user.

Hope this helps.

Regds
Systeemingenieurs Infoc
Valued Contributor

Re: switch user without giving a password

In a c-program, it should be prossible i guess.

man 1M setprivgrp - section SETRUGID

Never tried it out though
A Life ? Cool ! Where can I download one of those from ?
MANOJ SRIVASTAVA
Honored Contributor

Re: switch user without giving a password

There are following sceanorios


1. Login to another user from root < no passwd is required >

2.logging in from a user to another user n then u need to have the passwd may be you

3.may be you can try rlogin -l user name after setting it in $HOME of the suers.



Manoj Srivastava
Hamdy Al-Sebaey
Regular Advisor

Re: switch user without giving a password

Hi Maart,
I think I gave U the answer on this question, to make clearly to U just take this,
You cannot provide the password to the su within the script. You will always be prompted interactively.

If you are root, you can write:

# su - oracle -c
This will run Good luck,
Hamdy
Thanks for sharing knowledge
PIYUSH D. PATEL
Honored Contributor

Re: switch user without giving a password

Hi,

Any user except root is asked for the password during switching.

You can use sudo software if you do not want to be asked for the password. If you don't have sudo software use the following link to download it,

http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/sudo-1.6.6/

Piyush
Hamdy Al-Sebaey
Regular Advisor

Re: switch user without giving a password

Hi Mart,
I think U can do the following,
Simple - Create a user with uid "0".

<<>>>>>

Good luck,
Hamdy



Thanks for sharing knowledge