LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 08-14-2003, 02:39 AM   #1
gsibble
Member
 
Registered: Jul 2003
Distribution: Arch .5 and Solaris 9/10
Posts: 162

Rep: Reputation: 30
Question Two Quick and Dirty Ones!


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!!!
 
Old 08-14-2003, 02:44 AM   #2
Evilone
Member
 
Registered: Oct 2002
Location: UK
Distribution: Slack 9.1 (2.6.5)
Posts: 307

Rep: Reputation: 30
ifconfig is the answer to your first question.

The answer to your second , is yes you have to type su, i've not found a way round this yet.

and may i add your su nmap reference does also include typing su, is it really that much of a bother??

Last edited by Evilone; 08-14-2003 at 02:45 AM.
 
Old 08-14-2003, 02:46 AM   #3
gsibble
Member
 
Registered: Jul 2003
Distribution: Arch .5 and Solaris 9/10
Posts: 162

Original Poster
Rep: Reputation: 30
Cool, Exactly what I wanted for the first one. Now I KNOW in my heart that there is a way to do the 2nd one......just waiting for someone to tell me!!
 
Old 08-14-2003, 03:01 AM   #4
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Re: Two Quick and Dirty Ones!

Quote:
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.

Cool
 
Old 08-14-2003, 03:04 AM   #5
gsibble
Member
 
Registered: Jul 2003
Distribution: Arch .5 and Solaris 9/10
Posts: 162

Original Poster
Rep: Reputation: 30
22:35.3

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

Thanks again! Have a good night!
 
Old 08-14-2003, 03:14 AM   #6
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
You're welcome, and have fun linuxing

Cool
 
Old 08-14-2003, 03:31 AM   #7
gsibble
Member
 
Registered: Jul 2003
Distribution: Arch .5 and Solaris 9/10
Posts: 162

Original Poster
Rep: Reputation: 30
Hehe. Got it all done. Check out my fun aliases:

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!!!!

G'Night!

Last edited by gsibble; 08-14-2003 at 03:32 AM.
 
Old 08-14-2003, 03:32 AM   #8
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
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!

Cool
 
Old 08-14-2003, 03:33 AM   #9
gsibble
Member
 
Registered: Jul 2003
Distribution: Arch .5 and Solaris 9/10
Posts: 162

Original Poster
Rep: Reputation: 30
Ya, I'll be able to remember them. Worst comes to worst, .bashrc isn't that far away :P

In any case, I edited my last post so read it Cya!
 
Old 08-14-2003, 03:40 AM   #10
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
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.

Night!

Cool
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
KDE 3.5 is out! Quick 'n Dirty Upgrade Shade Slackware 19 12-25-2005 04:06 AM
Quick and dirty tutorial on networking? neocookie Linux - Networking 2 08-27-2004 07:22 AM
quick and dirty iptables firewalls -Nw- neX Linux - Security 3 06-04-2004 10:18 PM
quick and dirty! Smerk Debian 4 07-03-2003 08:33 PM
what's a quick and dirty way to block spam finegan Linux - General 1 12-03-2001 12:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration