ArkNinja Posted August 12, 2009 Posted August 12, 2009 Hello all, I am running Arch Linux with Wicd managing my wireless connections. At system startup it requires me to enter my password to get it to start up properly with access to the wireless interfaces, this can be a pain, especially when I incorrectly enter my password, and I have to manually start Wicd. This is in no way a necessity, but something that would make my life easier, and something that would be good to know in the future, as I can see different things that this could be useful for. My question is: Is there any way to permanently give root access to a program without it being reset at reboot. I think doing a chmod might work, but I am unsure. Thank you in advance, ArkNinja Quote
Burncycle Posted August 12, 2009 Posted August 12, 2009 You need it to be owned by root, world or group executable, and have the setuid bit set. To do this: chown root:group /path/to/file and then: chmod 4755 /path/to/file -or- chmod a+x,u+s /path/to/file ***WARNING:*** This is a dangerous practice to adopt, as it gives everyone who uses the machine a potential window to root access. I'm assuming you are the only one using this machine so it's _less_ dangerous, but just keep that in mind for the future. Quote
ArkNinja Posted August 12, 2009 Author Posted August 12, 2009 Thank you Burncycle, that fixed it. Is there any other way to do it more securely I doubt I will have any problem with it, but who knows, I would like to be more secure just in case. Quote
Burncycle Posted August 12, 2009 Posted August 12, 2009 Unfortunately, to do what you want it to, there is no other way to do it. The other thing you could do is lock down the executable permissions on the file so that only people in a certain group (for instance, your login group) can execute the binary. To do that: chgrp yourgroup /path/to/file chmod a-x,g+x /path/to/file This way, even though the binary still executes as root, you will be the only one who can execute it (theoretically). Quote
wh1t3 and n3rdy Posted August 13, 2009 Posted August 13, 2009 Boy oh boy i hope nobody gets access to your box. Quote
dr0p Posted August 13, 2009 Posted August 13, 2009 Personally I would just add it as an exception to the sudoers file, so that even though you have to still type "sudo" to run it as root, it doesn't prompt you for your password... I personally do this for my shutdown file so that I don't have to enter my password to shutdown / reboot. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.