Operating System - HP-UX
1753844 Members
7432 Online
108806 Solutions
New Discussion юеВ

sudo as another user not as root

 
T G Manikandan
Honored Contributor

sudo as another user not as root

sudo by default makes commands run as root.
I need to execute certain commands as another ordinary user.

Post the syntax in the sudoers file.

lazy to check the man pages


Thanks
3 REPLIES 3
Brian Markus
Valued Contributor

Re: sudo as another user not as root

This should do it.

-Brian.


# Give userid sysadmin the right to run any
# command from any machine as any user.
sysadmin ALL = (ALL) ALL

# liz is a consultant working for 10 clients.
# Give her the right to run any command as
# if she were one of her clients.
Runas_Alias LIZCLIENTS=andrea,susan,charlie, \
mikeg,jjack,jimk,mjones,bsmith, \
susiep,janjob
liz ALL = (LIZCLIENTS) ALL
When a sys-admin say's maybe, they don't mean 'yes'!
RAC_1
Honored Contributor

Re: sudo as another user not as root

User_to_run ALL=(run_as_user) NOPASSWD: "command"

should do it.
There is no substitute to HARDWORK
T G Manikandan
Honored Contributor

Re: sudo as another user not as root

THis is my sudoers file

still could not do that

root ALL = (ALL) ALL
User_Alias USERS = dtccm,ftccm,cma
Host_Alias POLDEV = 172.16.1.233
Cmnd_Alias TUXEDO = /opt/tuxedo/bin/*
# liz is a consultant working for 10 clients.
# Give her the right to run any command as
# if she were one of her clients.
Runas_Alias TUX=tuxadm
USERS POLDEV = (TUX) NOPASSWD: TUXEDO

i am trying to run the tuxedo commands.

Please revert