Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DHCP Renew / Root Commands 2

Status
Not open for further replies.

gwinn7

Programmer
Feb 10, 2001
1,004
US
This is a two part question...

#1 How can I force a release renew of the IP address on a Linux machine that is a DHCP client?


#2 Why is it that Linux commands are not available for use to a user account that has also been selected as part of the "root" group with admin rights? Even if I perform an "su root" using the user's account, the commands are still not available.


Thanks,
Gary
gwinn7
A+, Network+
 
You should be able to force a DHCP reconfiguration from the command line with /sbin/ifdown eth0
followed by /sbin/ifup eth0.
 
1. In Red Hat, 'pump' is the preferred command for renewing/releasing DHCP leases.

pump -i eth0 <--this will renew a lease

Read the man page for the options on your preferred DHCP client - pump, dhclient, dhcpcd, etc...

2. Do you not have permissions to the commands, or can you not find them when you su? If you can't find them, then they are not in your path. Try the locate command to see where they are on the disk. If they are not in your path, you have to use the full path to the commands, such as...

/sbin/pump -i eth0.

ChrisP

 
Great! Thanks!

ChrisP:

I should have these permissions. Even when I am in the same folder as the command and signed in as root, I have tried to execute it, but it would fail (ie. can't find it). I don't have a specific example at the moment, but when I do, I will post it.

So, I still don't understand why I can't execute certain commands under a different account, even though that account is belongs to the administration group with the same rights as root. That doesn't make sense to me. Shouldn't I at least get a message indicating that I don't have enough permissions to execute the command rather than not being able to find the command?

Thanks in advance,
Gary
gwinn7

 
When you are in the same folder as the command, did you call the command using ./command or using the full path to it?

Show me an example. Copy and paste the text on the console. Show me your current working directory (pwd) and the permissions on the command (ls -l) and also the command you are using that isn't working.

ChrisP ---------------------------------------
If someone's post was helpful to you, please click the box &quot;Click here to mark this post as a helpful or expert post&quot;.
 
OK, will do. I will post an example as soon as I have one.

Thanks for your help.

Gary
gwinn7
A+, Network+
 
I know it's not entirely you question but I find this handy and thought you might too.

If you 'su root' you keep your users path but if you 'su - root' you will inherit roots path which saves time (IMHO).

Hope this helps. [smurf]
01101000011000010110010001110011
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top