Linux - NewbieThis 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.
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.
Originally posted by gsibble 1. What is the fastest and easiest way to check my IP address adn the config of my current network situation? (IE="ipconfig" in windows)
2. If I have a program that needs some root privledges for something and I want to run it as root, but call it from my current user, how do I do this?
IE. I want to type something like "su && nmap -sS www.linuxquestions.org" but I know that isn't the way to do it.
I'd be happy to have it ask for the root pass, but I just want an easy way to run it without typing su each time.
Master, I'm timing how long it takes you to get the answer for these!!!
Sorry, been a bit busy tonight at the pharmacy
2. Using sudo would likely be what you are looking for, but you'll be in the predicament of still typing:
sudo /path/to/app
each time, it's a save of a few keystrokes in the end, and consider a better way of using root priv's than su - 'ing each time.
Check out man sudo for more info, it's really not as tricky as it reads though once you use it in practice.
WAAAAY too long tonight Master In any case, another great answer and even more convincing reasons for me to give LinuxQuestions some donations very soon!
Well, it's for aliases for things that I do all the time, like "nmap -sS" and changing from my wireless to my wired interfaces etc
alias ws="echo Changing Network Interface to Dell Truemobile 1150... && sudo /etc/sysconfig/network-scripts/ifdown eth0 && sudo /etc/sysconfig/network-scripts/ifup eth1"
alias wd="echo Changing Network Interface to 3COM 10/100 Adapter... && sudo /etc/sysconfig/network-scripts/ifdown eth1 && sudo /etc/sysconfig/network-scripts/ifup eth0"
You know you like it
Now the annoying part is that I can't make it ask for my root password, or at least haven't figured that part out yet. I wish it would because I don't want anyone logged in as me to be able to do this. I don't think it can be done though, at least without more editing of sudoer which is kinda scary to edit because one wrong line and there goes root's root privledges!!!!
Wow, that's a lot of stuff within an alias! Will you remember ws and wd? That's the only problem I've run into when using aliases. They are a great thing though!
Well, actually editing sudoers isn't as detrimental as that, not to my knowledge anyway.
Prompting for a root pass might be doable, but I don't think it'd be worth it in that situation. Best thing to do is make yourself a superuser group type thing, give yourself as little privs as you can in this group, but be able to perform small tasks that normal users can't. Then add your 'super user' to that group. It'll be a good learning experience along the way if nothing else.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.