The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Running script from other user rather than login user rawatds Shell Programming and Scripting 3 01-30-2009 01:18 PM
check user id before running script cpolikowsky UNIX for Dummies Questions & Answers 3 06-06-2008 01:02 PM
program running for one user and not for other user bryan UNIX for Advanced & Expert Users 2 11-13-2006 11:09 AM
What user is a process running as? america2 UNIX for Dummies Questions & Answers 1 05-21-2006 04:58 PM
Running su command from normal user shailendrat AIX 2 04-19-2005 09:32 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-13-2004
Gary Dunn Gary Dunn is offline
Registered User
  
 

Join Date: Jun 2004
Location: Il, hoffman estates.
Posts: 18
Question running a script under different user

Hello again,

I have a script, basically simple scp to copy files to a local machine for processing. The scp and ssh facilities use a specific user account requiring no password entry , simply /usr/bin/su - radacct

however, I need to run this script from cron under a different user account. I tried su'ing inside the script and that does not work. How do you do something like this ?

thanks
  #2 (permalink)  
Old 12-13-2004
bhargav's Avatar
bhargav bhargav is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2004
Location: USA
Posts: 511
U can't run the script as different user with out giving passwd.

Only user who can do this with out passwd is "root" without
prompting passwd.

su user "-c script"
  #3 (permalink)  
Old 12-13-2004
Gary Dunn Gary Dunn is offline
Registered User
  
 

Join Date: Jun 2004
Location: Il, hoffman estates.
Posts: 18
reply

There is a special account set up to do secure cp "scp" and secure shell "ssh".

when you /bin/su - radacct

then do a ssh or scp you do not have to enter a password.


in order to do a ssh or scp automatically you need to use this special account for scp and ssh.
  #4 (permalink)  
Old 12-13-2004
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,126
Virtually every modern version of unix allows non-root users to have crontabs. Why can't you just su to your special user and install the cron job?
  #5 (permalink)  
Old 12-13-2004
Gary Dunn Gary Dunn is offline
Registered User
  
 

Join Date: Jun 2004
Location: Il, hoffman estates.
Posts: 18
reply - thanks

Yeah,

I thought of that too. I tried it and for some reason unless I messed up it didn't work. I'll attempt it again with a clear head.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:27 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0