View Full Version : can't run ifconfig as su

24th January 2008, 04:39 AM
When I log into Fedora Core 8 and then log into root as su I cannot run any commands. I tried to run "ifconfig" and I got the message, "command not found". If I re-boot and log in as root, I can run the command line (i.e. ip, ifconfig, route, etc ...). Any ideas on what's going on?

24th January 2008, 05:02 AM
yup, certainly can clarify that one. If you use su after logging in or being logged in as a normal user, you must use "su -". If you login from a tty as root there is no problem. Logging in with su just gives you root privelages. Logging in with "su -" will actually change you to roots home and give you roots $PATH settings. Hope that helps :) just add a dash ;)

24th January 2008, 12:07 PM
ifconfig is in /sbin, which is in root's default path but not that of an ordinary user. If you use "su -", you get root's default path, but not if you use "su" (see the man page for su). You can run ifconfig either way if you type the full path: /sbin/ifconfig. In fact, if you're just using ifconfig to view information, you can do that as an ordinary user.