roseway:The Linux command is 'traceroute'. By default you have to run it as root (type 'su' in a terminal).
Eric
Not
quite! The relevant difference between root and an "ordinary" user is
that the executable for traceroute is within root's "PATH", and (by
default) not in an ordinary user's. For instance, if as root I do:
brandy:~ # echo $PATH
/sbin:/usr/sbin:/usr/local/sbin:/root/bin:
/usr/local/bin:/usr/bin:/usr/X11R6/bin:
/bin:/usr/lib/java/bin:/usr/games/bin:/usr/games:/opt/gnome/bin:/opt/kde2/bin:
/opt/kde/bin:/usr/openwin/bin:/opt/gnome/bin
I get a list of directory paths which are automatically searched for ececutable files. If I do the same as an ordinary user:
ted@brandy:~ > echo $PATH
/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/lib/java/bin:/usr/games/bin:
/usr/games:/opt/gnome/bin:/opt/kde2/bin:/opt/kde/bin:/usr/openwin/bin:.:/opt/gnome/bin
I get a somewhat different list. In particular it does not
include /sbin and /usr/sbin which are directories where certain
"system" binaries (of more interest to root than generally to other
users) are to be found. In particular, the traceroute command lives in
/usr/sbin:
brandy:~ # which traceroute
/usr/sbin/traceroute
which is nhot in the ordinary user's default PATH, but is in root's.Hence while root can simply do:
brandy:~ # traceroute smtp.zen.co.uk
traceroute to mailhost.zen.co.uk (212.23.3.98), 30 hops max, 40 byte packets
1 192.168.1.1 (192.168.1.1) 0 ms 0 ms 0 ms
2 gandhi-dsl1.wh.zen.net.uk (62.3.83.5) 39 ms 38 ms 38 ms
3 erazmus-ge-0-0-1-3.wh.zen.net.uk (62.3.80.197) 38 ms 39 ms 37 ms
4 bolzano-ae1-0.wh.zen.net.uk (62.3.80.50) 38 ms 38 ms 38 ms
5 spinoza-ae2-0.hq.zen.net.uk (62.3.80.54) 39 ms 38 ms 38 ms
6 lotze-ge-0-0-3-0.hq.zen.net.uk (62.3.80.66) 38 ms 39 ms 48 ms
7 epictetus-ge-0-0-0-11.hq.zen.net.uk (62.3.82.66) 39 ms 38 ms 38 ms
8 mailhost.hq.svc.zen.net.uk (212.23.3.98) 39 ms 38 ms 38 ms
because the 'traceroute' command is in /usr/sbin, which is one of
the directories in root's PATH and will be automatically searched for
the command if root just does 'traceroute', and so will be found.
However, the ordinaryuser has to do:
ted@brandy:~ > /usr/sbin/traceroute smtp.zen.co.uk
traceroute to mailhost.zen.co.uk (212.23.3.98), 30 hops max, 40 byte packets
1 192.168.1.1 (192.168.1.1) 0 ms 0 ms 0 ms
2 gandhi-dsl1.wh.zen.net.uk (62.3.83.5) 37 ms 39 ms 38 ms
3 erazmus-ge-0-0-1-3.wh.zen.net.uk (62.3.80.197) 38 ms 37 ms 38 ms
4 bolzano-ae1-0.wh.zen.net.uk (62.3.80.50) 37 ms 47 ms 40 ms
5 spinoza-ae2-0.hq.zen.net.uk (62.3.80.54) 38 ms 39 ms 39 ms
6 lotze-ge-0-0-3-0.hq.zen.net.uk (62.3.80.66) 40 ms 38 ms 38 ms
7 epictetus-ge-0-0-0-11.hq.zen.net.uk (62.3.82.66) 40 ms 39 ms 38 ms
8 mailhost.hq.svc.zen.net.uk (212.23.3.98) 38 ms 38 ms 37 ms
i.e. spell out the full path /usr/sbin/tracroute, because /usr/sbin is not in ted's PATH.
So,
so long as an ordinary user knows where the file lives, that user can
execute it by spelling out the full path to the command as above --
provided, of course, the permissions of the file allow an ordinary user
to execute it (which is not the case for all commands). In the case of
tracroute, this is OK:
ted@brandy:~ > ls -l /usr/sbin/traceroute
-rwsr-xr-x 1 root
root 21032 May 11 2001
/usr/sbin/traceroute
showing that root's permissions ("rws") allow the file to be
read ("r"), written to/deleted ("w"), and executed with special
privileges ("s"); while any user in root's group has permissions "r-x"
allowing the file to be read ("r") and executed with orfinary
privileges ("x"), but not written to or deleted ("-") -- and exactly
the same for an ordinary users ("r-x" again).
Hoping this helps reveal a little of "what's under the bonnet"!