LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-22-2003, 05:10 AM   #1
Rex_chaos
Member
 
Registered: Aug 2001
Location: GD, GZ, China
Posts: 240

Rep: Reputation: 30
script and password input


hi all,
I wonder if it's possible to input a password directly with a script. I've tried

echo "xxxxxx" | su userA

but fails.

I know it's too bad to do this. However, I really need it. Please help!
 
Old 07-22-2003, 03:04 PM   #2
bentz
Member
 
Registered: Mar 2003
Distribution: Fedora, Mac OSX
Posts: 362

Rep: Reputation: 30
I suggest you look into sudo. You can establish a 'sudo' rule that says that a certain unprivileged user is allowed to run a certain command from a certain host as a certain user (in your case root).

su is not designed to accept passwords from stdin, so your current approach is not going to work.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
ow to create script change a user's password? passwd expects input from keyboard.. Arodef Linux - General 1 03-02-2005 10:40 PM
backslash input in script esasse Linux - Newbie 6 02-17-2005 06:55 AM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 12:20 AM
cant input password on suse 8.0 pro nleber01 Linux - Newbie 11 02-07-2004 09:50 AM
input password & shell Rex_chaos Linux - General 1 08-01-2003 08:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:29 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration