DebianThis forum is for the discussion of Debian Linux.
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.
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.
I have to run pump to access the internet. I have to be root to run pump. It allworks fine, but it would be severalsteps faster for me if I could run pump as user rather than as root.
I have tried changing pump's group to mine--still get the message "pump: must be run as root." Then I changed owner to my username. Same message. pump is located in /sbin, so I changed the group ownership of sbin to my group. Still the samemessage.
The permissions for pump are (and have always been) -rwxr-xr-x suggesting that the "world" as well as the owner and the group members should be able to run pump.
It's just one of those frustrating little problems that I should be able to to solve and havn't been able to.
Well, right off the bat I want to say - for a good security system, you SHOULD have to be root to run pump. If this seems cumbersome, try the "su -" command - this will ask you for the root password, and change your shell to root accesses temporarily. Type "exit" in that same shell to become your regular user again. Even better, you can type "sudo command", it will ask you for the password, and then run only that command as root (e.g. pump).
Anyways, you are correct those file permissions allow people to run pump. However, just because you can run pump, doesn't mean pump has the proper permissions to change your network settings. For example, if you downloaded a pump binary yourself from the internet into your user directory and ran it, the system wouldn't let you just modify all the network settings either, just like putting a USB stick in the machine with "fdisk" on it wouldn't let you format the boot drive of the system. You have to be running pump as root for it to do its work. You can solve this problem by setting pump's binary to have root permissions. You can do this by typing "chmod +s /sbin/pump" - then this will probably work. However, THIS IS A VERY BAD IDEA, AND I STRONGLY SUGGEST YOU DO NOT DO THIS. You can revert this change with "chmod -s /sbin/pump". If later a bug is found in pump that allows you to manipulate the program to do other things (like a buffer overflow), any user will be able to get root access to your system to do ANYTHING THEY WANT. Further, even without a flaw in pump, any user who logs into your machine, or any program a user runs will be able to change any of the network settings they can get pump to change for them. The system is set in place to protect you and your system, so please check out the solution in the first paragraph. I'm only telling you this solution to teach you more about how your system works, but please don't actually use it in your system, unless you just want to test that it works.
If you have any questions about any of this, please ask, it's a good thing for administering a linux box to understand well!
Thanks for such a complete and educational answer.
My machine boots to a command line login. At this point I login as user. I have been
doing the following:
su
enter
root password
enter
pump
enter
wait several seconds for pump to return
"etho: setting 100mbs full-duples based on auto-negotiated partner ability 45 e1.
exit
enter
and I am back to user at which point I startx.
I thought I wanted to cut out the extra steps su to root in order to have the internet access
set up when I started x.
It looks like the sudo-command-password would be the appropriate way to go since
I only want to run the one command. However, when I type 'sudo pump' I get "sudo: command not found
I had no concept of the dangers involved. Haven't learned much about security yet.
BTW the chmod +s /sbin/pump worked perfectly, as did chmod -s /sbin/pump.
What was bugging me was being unable to run pump as user. I have now
"been there, done that" and I can now go back to becoming root to run pump, without being frustrated.
Anytime - by the way, the "sudo" program should be in a package in your distro by the same name, you might want to look it up . It's also handy to let you run X programs as root, which "su" won't let you easily do.
And, your system should have an option to run "pump" as part of the system startup, and then you won't have to worry about "su"ing into root or anything like that to get connected. Maybe you already know this, or maybe there's some reason you're not doing that, but just making sure you've thought of it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.