[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: BUG or OPERATOR error? - was [Re: Measuring aggregate internet useage?]



On 04/26/2017 10:17 AM, Greg Wooledge wrote:
On Wed, Apr 26, 2017 at 10:07:01AM -0400, Ric Moore wrote:
"ifconfig" has to be run as root.
ric@iam:~$ sudo ifconfig
[sudo] password for ric:
enp8s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

This is not correct, if you are just using it to view an interface rather
than to change the interface.

ifconfig lives in the /sbin directory, which is not in the default PATH
that user accounts get when they login.  It *is* in the PATH that you
get when you run su, or sudo.  That's why it works when you slap sudo
in front of it.

You could also simply run /sbin/ifconfig directly.  Or, you could change
your PATH variable to include the /sbin directory.  Either of these will
let you run ifconfig without root privileges.

And that makes me incorrect how?? For a new user, who doesn't want to dink with $PATH, su or sudo will run ifconfig. It doesn't run, out of the box, as USER, which was the OP's original issue. Ric
.


--
My father, Victor Moore (Vic) used to say:
"There are two Great Sins in the world...
..the Sin of Ignorance, and the Sin of Stupidity.
Only the former may be overcome." R.I.P. Dad.
http://linuxcounter.net/user/44256.html


Reply to: