Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-04-2012, 10:15 AM
|
#1
|
Member
Registered: Oct 2012
Location: Belgium
Distribution: Xubuntu
Posts: 32
Rep: 
|
Running sudo commands from a script
Hi,
I'm trying to start airmon-ng and airodump-ng from a script, but it won't run without elevated privileges.
I need this to automatically start wireshark on the same channel as a router is configured.
All the systems are on a separate test-network where security is not an issue nor need my scripts to be portable.
Can I simply chmod the scripts from aircrack-ng to execute for any user ?
Or is there a better way that is not anymore complicated than this ?
kind regards
|
|
|
12-04-2012, 10:28 AM
|
#2
|
Moderator
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
|
Just start the script with sudo.
|
|
|
12-04-2012, 10:29 AM
|
#3
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,681
|
Quote:
Originally Posted by oneindelijk
Hi,
I'm trying to start airmon-ng and airodump-ng from a script, but it won't run without elevated privileges.
I need this to automatically start wireshark on the same channel as a router is configured.
All the systems are on a separate test-network where security is not an issue nor need my scripts to be portable.
Can I simply chmod the scripts from aircrack-ng to execute for any user ?
Or is there a better way that is not anymore complicated than this ?
kind regards
|
Not sure what the problem is. Just putting "sudo" in front of a command in a script will let it work with root/elevated privileges. If you put the NOPASSWD directive into the sudoers file for a user/group, that does it.
|
|
|
12-04-2012, 11:37 AM
|
#4
|
Moderator
Registered: May 2001
Posts: 29,417
|
Moved: This thread is more suitable in the Linux Newbie forum (your question isn't related to Linux Security) and has been moved accordingly to help your thread/question get the exposure it deserves.
|
|
|
12-11-2012, 02:42 AM
|
#5
|
Member
Registered: Oct 2012
Location: Belgium
Distribution: Xubuntu
Posts: 32
Original Poster
Rep: 
|
Quote:
Originally Posted by TB0ne
Not sure what the problem is. Just putting "sudo" in front of a command in a script will let it work with root/elevated privileges. If you put the NOPASSWD directive into the sudoers file for a user/group, that does it.
|
Hi,
I found this solution in another thread. I also put the user in the 'sudo' group. I don't know if that was unnecessary, I'm just mentioning it...
Thanks anyway
|
|
|
All times are GMT -5. The time now is 01:42 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|