Ssh to role


 
Thread Tools Search this Thread
Operating Systems Solaris Ssh to role
# 1  
Old 03-04-2015
Ssh to role

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

Last edited by vbe; 03-04-2015 at 09:30 AM.. Reason: code tags
# 2  
Old 03-04-2015
In the same way you got it working in one way... Sorry I am unclear with what you wrote, is the line between code tags work?
Or are you saying you cannot... Because truly already that line is unclear...
# 3  
Old 03-04-2015
Thanks vbe for responding

What I intent to do is to run a command remotely using a role user.
In the target host the command will be execute by a role user, not a normal usr.

That's it all that I need to know

---------- Post updated at 09:58 AM ---------- Previous update was at 09:44 AM ----------

The command will not be executed interactivilly, it will be executed automatically with a script invoked by a cron in a server that is going to do a ssh to the intended server and executed the command with a role user on the target server.
# 4  
Old 03-04-2015
Hello,
I run remote commands on servers all the time, though we use sudo.
Code:
ssh server sudo command

Sometimes ssh has issues and the commands works better with the -t option, try that.
Code:
ssh -t server command

I hope this helps.

Last edited by rbatte1; 03-05-2015 at 12:12 PM.. Reason: Changed ICODE tags to just CODE tags
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Cybersecurity

Role based access and security

Hello, We are planning to setup a Role based access and security to our Linux servers. We can use mostly use sudo for providing the limited access to service and files. My query is that how can we manage that members can edit/access only specific files (it would be 1 or multiple files or... (3 Replies)
Discussion started by: sunnysthakur
3 Replies

2. Solaris

Role not executing command

Hello Guys, I am studying RBAC. So I create a role called sysadm and gave it the "shutdown" profile. Now when I switch to that role, and execute the shutdown command $ shutdown -y -g0 -i5 The system responds with : shutdown: not found Can anyone help me with this please?... (1 Reply)
Discussion started by: cjashu
1 Replies

3. Shell Programming and Scripting

Need Role Name for my type of work

Hi , I am planning for the interview . I am having one question here , I worked on unix and shellscripting for 2 years Done- Ø Coding and testing of Server Monitoring ShellScripts Ø Deployment on UNIX production environment I have written so many shellscripts for monitoring... (5 Replies)
Discussion started by: aish11
5 Replies

4. Linux

What's role of swap in initrd?

Hello, I want to know why initrd need swap for work. In the shell of mkinitrd, it look for the swap partation for "swsuspdev", then write a sentence "resume /dev/sdXX" in the file init from initrd.gz, and the /dev/sdXX is the swap partation. Why initrd need swap when it boot a system? what is... (4 Replies)
Discussion started by: ZR_Lang
4 Replies

5. AIX

role based user

Hi .. I need to assign role based permission to users... How to assign role based permission in aix... Thanks.. (4 Replies)
Discussion started by: sumathi.k
4 Replies

6. What is on Your Mind?

UNIX starter role?

This may not be the right forum to put up a question like the one I'm about to ask. I am hoping that I would get very fruitful responses. i) I have been learning UNIX for sometime now, but my question is realistically what do I need to be able to be able to apply for UNIX jobs. What sort of... (6 Replies)
Discussion started by: B_Jay
6 Replies

7. What is on Your Mind?

Role of AI in any OS

In any given operating system, generally how much of AI software is involved? Is it related to user-friendliness of OS? What is the future of strong AI? (3 Replies)
Discussion started by: MULTIVERSE
3 Replies
Login or Register to Ask a Question