- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Run some commands on multiple servers - with roo...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2010 11:54 PM
03-25-2010 11:54 PM
Run some commands on multiple servers - with root user privillage
Hi All,
We have around 600+ server in datacenter. Now I am trying to run some commands (which collect some data for auditing) through some script.
I know it can be done by remeshd from root , but its against sec settings.
I am running one script which will, do ssh ( give password using expect) , then sudo sh ( againg give password using expect)
The script is working for ssh, but its giving error on sudo sh
This is the error I am getting. “sudo: no tty present and no askpass program specified”
I know that, if I put “visiblepw” entry in sudoers file , it will allow to run sudo from script. But its not possible for me to change sudoers file now.
Is there any way I can achieve this without changing sudoers file????
Hope , there will be tricks ….
Rgds
Prasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2010 02:58 AM
03-26-2010 02:58 AM
Re: Run some commands on multiple servers - with root user privillage
You could fix this by using the option "-t" with ssh to force ssh allocate a pseudo-TTY even with non-interactive connections.
I have not checked whether SSH can detect expect as "non-interactive" or not: if a single "-t" option does not help, use "-tt" to absolutely force SSH to allocate a pseudo-TTY at the remote end even if it does not have one at the local end.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2010 07:21 AM
03-26-2010 07:21 AM
Re: Run some commands on multiple servers - with root user privillage
You can set up a set of SSH keys which allow root access directly to the system, and even lock down the keys to permit only specific commands to be run, and only from a specific host.
As long as the private key has no password, or the key is stored at the beginning of the run in a key agent, then there is no password prompt once the remote system is connected.
Check out the documentation specifics for the authorized_keys file for details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2010 09:23 PM
03-26-2010 09:23 PM
Re: Run some commands on multiple servers - with root user privillage
in host1
1.mkdir .ssh
2.cd .ssh
3.ssh-keygen -t rsa
two files will be generating
add the host entry of host2 in host1.
in host2
repeat the first 2 steps
copy the id.rsa.pub key from host1 in to .ssh of ur home dir.and the same u redirect to authorized_keys.
set 700 for .ssh and 600 for authorized keys
so that u no need to edit sudoers file.
without asking password u can run sh in all .
regards
MC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2010 12:16 AM
05-17-2010 12:16 AM