LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-15-2006, 11:38 AM   #1
r3gan
LQ Newbie
 
Registered: Jan 2006
Distribution: Debian
Posts: 12

Rep: Reputation: 0
Changing user in bash script.


Hi,

I'm new to bash scripting, and I have a problem with running the 'su' command. When I try to 'su' in my script, I get prompted for the user's password. Is there any way to echo a password from my script to the waiting prompt??
 
Old 03-15-2006, 12:04 PM   #2
alunduil
Member
 
Registered: Feb 2005
Location: San Antonio, TX
Distribution: Gentoo
Posts: 684

Rep: Reputation: 62
man su, and you'll find your answer.

Regards,

Alunduil
 
Old 03-15-2006, 12:16 PM   #3
r3gan
LQ Newbie
 
Registered: Jan 2006
Distribution: Debian
Posts: 12

Original Poster
Rep: Reputation: 0
alunduil,
I have already checked the man pages for 'su'. From what I can see, there is no -p option or anything to submit a password as an arguement to the 'su' command.
 
Old 03-15-2006, 12:27 PM   #4
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 56
If you can, there is a tool for this:
sudo

for su maybe with expect language but sudo is really for this.
 
  


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
changing path from a bash script ggeeoo Linux - Newbie 7 01-04-2006 07:35 PM
add user bash script noir911 Programming 4 08-13-2005 09:24 AM
how to change user in bash script c0d3 Programming 6 07-27-2005 12:34 PM
changing user in a shell script sanjith11 Programming 6 03-22-2004 02:18 PM
User input using a BASH script... causticmtl Programming 5 07-13-2003 10:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:47 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration