LinuxQuestions.org
Register a domain and help support LQ
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 08-23-2003, 07:34 PM   #1
chup
Member
 
Registered: Aug 2003
Location: South Africa
Distribution: Ubuntu (Feisty)
Posts: 280

Rep: Reputation: 30
Question Shell script login command?


i have a problem. ive created a shell script to perform certain commands to initialize my wlan adapter. but, in order to perform the commands listen in the shell script, you have to be root. is there any way for me to let the script ask for the su pass, and then exec the commands? because when i do it like this:
Code:
su
*wlan_initialize_commands*
it asks for the password, but then just ignores the commands
 
Old 08-23-2003, 08:39 PM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
When are you wanting this script to run, at boot up or when the user logs in? If at boot up, you could put the script in rc.local and won't have to worry about the root password.

The other way mentioned is a security risk, I'm not the greatest on scripting but if you were to put root's password in that script, then your basically giving root's password out.

You could also just set it up so that particular user has access to those given commands in the script..
 
Old 08-24-2003, 10:09 AM   #3
chup
Member
 
Registered: Aug 2003
Location: South Africa
Distribution: Ubuntu (Feisty)
Posts: 280

Original Poster
Rep: Reputation: 30
Quote:
You could also just set it up so that particular user has access to those given commands in the script.
will i have to use sudo then, and if i have to use sudo, can you explain it to me a bit?
 
Old 08-24-2003, 06:43 PM   #4
chup
Member
 
Registered: Aug 2003
Location: South Africa
Distribution: Ubuntu (Feisty)
Posts: 280

Original Poster
Rep: Reputation: 30
and btw, i cant add the commands to rc.local or any other startup scripts, because i have to unplug and re-plug the adapter before i can use the commands :S
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check in a script whether the shell is login or non login? frankie_DJ Programming 5 09-06-2005 06:01 AM
Command in shell script Grassie Coetzee Linux - Software 1 03-13-2005 11:42 AM
Use a shell script to do login and other commands jpan Linux - General 15 01-12-2005 06:52 AM
login message shell script? jczr2 Linux - Newbie 22 05-28-2003 09:10 PM
telnet login via shell script lethe Linux - General 8 05-13-2002 09:31 AM


All times are GMT -5. The time now is 05:14 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