cancel
Showing results for 
Search instead for 
Did you mean: 

Change of user using su -

 
Gustavo Souza Lima
Frequent Advisor

Change of user using su -

Hi,

I have a user named producao and another user named prd1bea. I need allow that the use producao runs the command (su - prd1bea) and change to user prd1bea without prompting password.
How Can I do it???
6 REPLIES
Grayh
Trusted Contributor

Re: Change of user using su -

Install sudo or RABC and assign roles
piyush mathiya
Trusted Contributor

Re: Change of user using su -

Your user "PRODUCAO" must be having root access, you must have to use sudo or nsu or any other tool to give root access or you need to change UID of "PRODUCAO" to 0 but in this situation the user can do whatever they wants to do into the system...
Autocross.US
Trusted Contributor

Re: Change of user using su -

Use sudo.

Run visudo and add the following to the sudoers file:

producao ALL = NOPASSWD: /usr/bin/su [-] prd1bea

Then, to su to the user, run:

sudo su - prd1bea
I drive way too fast to worry about calories.
jaivinder
Frequent Advisor

Re: Change of user using su -

SUDO is the best option to allow the user switching because it is safe and secure.
To provide the su access to the user just download the sudo package from the HP site and install it. Once installed you can edit the permissions by adding the user names in the sudoers file by visudo command.
OldSchool
Honored Contributor

Re: Change of user using su -

Sudo will work...if you need to monitor this then you might look at PowerBroler, but it's a commercial product and will have a cost associated with it

(See the response from Autocross and jaivinder.)

while what piyush describes will allow the user to "su - " w/o passwd, it also provides root level access to the entire system. And, should you removing that user and the files they own would result in a crashed system. It will cause you to fail security audits of all kinds, and if I found someone doing that here....well...they'd be looking elsewhere for work.
Gustavo Souza Lima
Frequent Advisor

Re: Change of user using su -

I have set ssh connection without password.
When the user producao make a ssh to the same machine but with the user prd1bea, the connection is established without password.

Thank you for the help.