View Full Version : [ubuntu] to perform admin tasks from script
March 15th, 2012, 04:16 PM
i need to execute the command ifconfig eth0 x.x.x.x from a shell script !! but it needs admin privileges i don't know how to solve this problem please help me !
March 15th, 2012, 04:24 PM
Welcome to the Ubuntu Forums!
You get administration privileges by running sudo 'superuser do' and the command.
So in your case
sudo ifconfig eth0 x.x.x.x
Good luck :-)
March 15th, 2012, 04:33 PM
if you want sudo in a script without prompting for password,
username ALL=(ALL) NOPASSWD: ALL
save and that's it.
the username is the user you want to give doing sudo without password.
But as yu can see the above process has security issues .
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.