Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Ssh to role

$
0
0
Hi all

I need to run a command that only a role user and root can run, I need to run that command remotely by script but the roles ask for a password.

Ex. from serverA with userA to serverB with userB:
userA can ssh serverB using userB without askink for a password.
Code:

ssh userB@serverB  su  roleuser -c "/usr/sbin/savegroup"
user1 es a user tha can do su to roleuser
roleuser is a role that can execute /usr/sbin/savegroup

the matter is that when I try to do tha remotely it says : su: Sorry

how can i achieve my goals

Thanks for any help

Viewing all articles
Browse latest Browse all 16232

Trending Articles