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.
|
 |
11-27-2007, 06:33 PM
|
#1
|
Member
Registered: Feb 2004
Location: Albuquerque
Distribution: Fedora 9
Posts: 46
Rep:
|
suid / su questions
hey all. Quick question if you have a few minutes. Anytime I try to do suid anything, it asks me for a password. When I put in my root password, it says it's invalid. I can switch user using su and put in the root/password and things work fine. What do I not know about suid that I can use to get this to work?
Also, I can't run ifconfig or iwconfig under my user account but I can under root. I try to use the suid command, but run into the above problem. Any advice on this one?
Thanks for the help.
|
|
|
11-27-2007, 09:17 PM
|
#2
|
Senior Member
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443
Rep:
|
I don't think ifconfig or iwconfig are in your path, but you should be able to run them (at least for viewing the current configuration). To see if something is in your path try
ifconfig, for instance, should be under /sbin so try
suid just runs a process with root privileges. I doubt you modified the binary file's perms to do this so I'm guessing you are really talking about sudo. If sudo is setup to give your user permissions for a command then you can use it, BUT you are supposed to enter in your password (NOT root's).
|
|
|
11-27-2007, 10:48 PM
|
#3
|
Member
Registered: Feb 2004
Location: Albuquerque
Distribution: Fedora 9
Posts: 46
Original Poster
Rep:
|
Thanks Shadowsnipes, that's what I was looking for. sudo was what I was referring to.
so how can I make it to where my user can run the commands? Can I just copy the /bin folder to /home/user/bin or is there a way to let user reference the /bin library?
also, with sudo, I put in the user password but it tells me that "user is not in the sudoer file". how can I give sudo privileges to user? (I've been using my root account for playing around because of this and I'd like to remedy it).
|
|
|
11-27-2007, 11:08 PM
|
#4
|
Member
Registered: Feb 2003
Location: St. Louis
Distribution: RedHat 8
Posts: 262
Rep:
|
Quote:
Originally Posted by usafitz
Thanks Shadowsnipes, that's what I was looking for. sudo was what I was referring to.
so how can I make it to where my user can run the commands? Can I just copy the /bin folder to /home/user/bin or is there a way to let user reference the /bin library?
also, with sudo, I put in the user password but it tells me that "user is not in the sudoer file". how can I give sudo privileges to user? (I've been using my root account for playing around because of this and I'd like to remedy it).
|
you need to run visudo to add your users to the sudoers list. Just follow the example within the sudoers file. As for the commands itself, you can add all /sbin, /bin, /usr/bin, and /usr/sbin to your user path.
|
|
|
11-27-2007, 11:37 PM
|
#5
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.x
Posts: 18,442
|
I'd recommend using the visudo approach. The access restriction is there for a reason (security).
For anyone else reading this thread:
sudo asks you for YOUR passwd, su (or su -) asks for the target user's passwd, by default root unless you specify another username, in which case their passwd.
|
|
|
11-28-2007, 06:51 AM
|
#6
|
Member
Registered: Feb 2004
Location: Albuquerque
Distribution: Fedora 9
Posts: 46
Original Poster
Rep:
|
awesome, I'll take that approach. Thanks for the advice.
|
|
|
11-28-2007, 10:38 AM
|
#7
|
Senior Member
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443
Rep:
|
On my desktop I am the only user that needs any kind of admin privileges so I don't use sudo. I prefer to simply make my user a part of the wheel group which allows me to su to root. I then use my fourth virtual desktop ONLY for root activities. I also setup a screen profile for root so that when I use screen it sets up a couple of nodes for tailing logs, and another for a regular local prompt. Using this, I only need one virtual terminal for root.
Even when using distros that make a lot of use of sudo, such as Ubuntu, I tend to prefer keeping a root terminal on my last virtual desktop so I can get admin work done quicker. Obviously if you need to have some users that only have certain root privileges, sudo is the preferred method.
|
|
|
11-28-2007, 07:38 PM
|
#8
|
Member
Registered: Feb 2004
Location: Albuquerque
Distribution: Fedora 9
Posts: 46
Original Poster
Rep:
|
Quote:
Originally Posted by cojo
you can add all /sbin, /bin, /usr/bin, and /usr/sbin to your user path.
|
How can I do this?
|
|
|
11-28-2007, 11:13 PM
|
#9
|
Senior Member
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443
Rep:
|
I wouldn't recommend adding /sbin and /usr/sbin to a regular users path. Just type /sbin or /usr/sbin in front of those specific commands you want to run (eg. /sbin/ifconfig).
To change your PATH (or any environment variable) you simple use export
Code:
export PATH="/some/path:/some/other/path:$PATH"
Notice I included the current variable in their so the command only adds to it. This of course is only temporary for the terminal you run it in.
If you want to make it permanent you might want to change it in your .profile script. If you don't know what I am talking about search around in the forums for .bashrc
Please note that if you simply su as root you won't have to worry about the path or typing "sudo" for all of your commands!
Type in the root password and you're root. Just set that terminal aside or change its color so you don't get in the habit of using it for stuff you don't need it for.
|
|
|
All times are GMT -5. The time now is 10:32 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
|
|