Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 01-01-2010, 05:43 AM   #1
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 668
Blog Entries: 7

Rep: Reputation: 31
Execute script on local server as normal user to run commands on remote server

Dear All
I have an immutable script on server A, it executes a maintenance command on the remote servers where elevated privileges are needed.

I want the developers on server A to execute the script and run it without being prompted for a password.

The script contains scp root@serverB and ssh 'root@serverB', if run as root it runs great since I am using ssh keys. However, as regular users they are prompted for a password.

If I do created their group on server B...etc and give the group sudo it would still ask for passwords right ?

Can I overcome this ?

Old 01-01-2010, 07:30 AM   #2
Registered: Jul 2009
Location: Reston, VA
Distribution: Slackware, Ubuntu, RHEL
Posts: 183

Rep: Reputation: 46
you can use a passphrase-less ssh-identity, or consider running an ssh-agent with the key you are using for scp loaded into it.

for example:

(as the sudo user)

ssh-agent >
ssh-add whatever.key

then in your script, just do source before running the scp command.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Cant execute commands that is in sbin/ with normal user. tERn Linux - Desktop 1 10-16-2009 12:18 PM
Execute script from central server without uploading to remote machines zugly Linux - Newbie 7 03-18-2009 12:39 PM
Execute commands or scripts on a remote server gurl4sh25 Linux - Software 3 06-27-2007 10:04 PM
Remote Win Bat File execute Shell Script on AIX Server DriveMeCrazy AIX 5 05-26-2004 07:24 PM

All times are GMT -5. The time now is 03:37 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration