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
Root ENV is different from users', how to change? alanlh SUN Solaris 4 06-06-2007 11:47 PM
Change a users primary group after login terrym UNIX for Advanced & Expert Users 3 02-09-2007 03:03 AM
Change users login name spacewalker AIX 9 03-20-2006 11:09 AM
How to change default email sent to new users calivw78 UNIX for Advanced & Expert Users 2 01-18-2002 04:37 PM

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 02-15-2002
chorgan chorgan is offline
Registered User
  
 

Join Date: Dec 2001
Posts: 3
Question How do I change users in a script???

Hi there,

Does anyone know of a way I can become a different user in a script? I need to run a script as one user (not root), and change to another user half way through.

It stops and asks me for the password, and I can't find a way to feed the password in through the script.


Thanks
  #2 (permalink)  
Old 02-15-2002
edog edog is offline
Registered User
  
 

Join Date: Sep 2001
Location: Green Bay, WI
Posts: 66
search on this forum for expect , and sudo, both of these tools will enable you to run a command or script as a different user
  #3 (permalink)  
Old 02-15-2002
thehoghunter
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
Startup scripts can be modified to start a application not as root but as the application userid via the su command. Check the man page on su and the -c option.
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 08:07 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