LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 01-01-2010, 04:43 AM   #1
ALInux
Member
 
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 ?

Regards
 
Old 01-01-2010, 06:30 AM   #2
GooseYArd
Member
 
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 > agent.sh
source agent.sh
ssh-add whatever.key

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


Reply


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 11:18 AM
Execute script from central server without uploading to remote machines zugly Linux - Newbie 7 03-18-2009 11:39 AM
Execute commands or scripts on a remote server gurl4sh25 Linux - Software 3 06-27-2007 09:04 PM
Remote Win Bat File execute Shell Script on AIX Server DriveMeCrazy AIX 5 05-26-2004 06:24 PM


All times are GMT -5. The time now is 06:53 PM.

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