From: Stephen Powell on
On Thu, 28 Jan 2010 19:11:29 -0500, Vincent Lefevre wrote:
> On 2010-01-28 16:09:11 -0500, Stephen Powell wrote:
> > By default, ifconfig only shows active interfaces. Issue "ifconfig -a"
> > to show *all* interfaces. (You have to be root of course.)
>
> No need to be root!

On my system you *do* need to be root.

$ ifconfig
-bash: ifconfig: command not found
$ su
Password: [enter root password]
# ifconfig
.
. (expected output from ifconfig
.

The problem is that, by default, ordinary users don't have
/sbin in their PATH variable. Not on a plain-vanilla
Debian system. But it's true that an ordinary user can
run ifconfig by issuing

$ /sbin/ifconfig

or by modifying the PATH variable to include /sbin.


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
From: Celejar on
On Thu, 28 Jan 2010 17:29:54 -0500 (EST)
Stephen Powell <zlinuxman(a)wowway.com> wrote:

> On Thu, 28 Jan 2010 16:27:47 -0500, Celejar wrote:
> > No need to erase the whole file, or to shutdown / reboot (assuming the
> > relevant driver is built as a module). As I note here, just comment out
> > the relevant line, and then unload and reload the relevant kernel
> > module.
>
> I figured there was probably a less disruptive way, but I knew that erase /
> reboot would work, assuming only one NIC. But since we're on the subject,
> just what would the "relevant kernel module" be? The device-specific
> driver for the NIC, such as xirc2ps_cs, for example? Or a more general
> networking module? What would be the exact procedure? I'm guessing
> something like:
>
> [edit rules file]
> ifdown eth1
> modprobe -r xirc2ps_cs
> modprobe xirc2ps_cs
> ifup eth0 [if needed]

I'm pretty sure this is right - I've done this sort of thing with my
wireless drivers (b43, ath5k). The device nodes are created by the
chipset-specific drivers, so they're the ones relevant to the udev
system, IIUC.

Celejar
--
foffl.sourceforge.net - Feeds OFFLine, an offline RSS/Atom aggregator
mailmin.sourceforge.net - remote access via secure (OpenPGP) email
ssuds.sourceforge.net - A Simple Sudoku Solver and Generator


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
From: Vincent Lefevre on
On 2010-01-28 19:57:42 -0500, Stephen Powell wrote:
> On Thu, 28 Jan 2010 19:11:29 -0500, Vincent Lefevre wrote:
> > On 2010-01-28 16:09:11 -0500, Stephen Powell wrote:
> > > By default, ifconfig only shows active interfaces. Issue "ifconfig -a"
> > > to show *all* interfaces. (You have to be root of course.)
> >
> > No need to be root!
>
> On my system you *do* need to be root.

By using /sbin (in the command line or in $PATH) as you noticed, this
is not needed. For security reasons, it's better to run commands as
normal users rather than root.

BTW, I wonder why ifconfig is in /sbin instead of /bin. It isn't more
a system command than ping or netstat, for instance. And if this is
because some of its use needs to be root, this is the same for date.

--
Vincent Lef�vre <vincent(a)vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Ar�naire project (LIP, ENS-Lyon)


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
From: Stephen Powell on
On Thu, 28 Jan 2010 22:37:07 -0500, Celejar wrote:
> On Thu, 28 Jan 2010 17:29:54 -0500, Stephen Powell wrote:
> > On Thu, 28 Jan 2010 16:27:47 -0500, Celejar wrote:
> > > No need to erase the whole file, or to shutdown / reboot (assuming the
> > > relevant driver is built as a module). As I note here, just comment out
> > > the relevant line, and then unload and reload the relevant kernel
> > > module.
> >
> > I figured there was probably a less disruptive way, but I knew that erase /
> > reboot would work, assuming only one NIC. But since we're on the subject,
> > just what would the "relevant kernel module" be? The device-specific
> > driver for the NIC, such as xirc2ps_cs, for example? Or a more general
> > networking module? What would be the exact procedure? I'm guessing
> > something like:
> >
> > [edit rules file]
> > ifdown eth1
> > modprobe -r xirc2ps_cs
> > modprobe xirc2ps_cs
> > ifup eth0 [if needed]
>
> I'm pretty sure this is right - I've done this sort of thing with my
> wireless drivers (b43, ath5k). The device nodes are created by the
> chipset-specific drivers, so they're the ones relevant to the udev
> system, IIUC.

Thanks, Celejar. Tong also confirmed that it worked. One other item in the
procedure that I neglected to mention is to edit /etc/network/interfaces
to make sure that it says eth0 instead of eth1. Typically, it already
says eth0 and that's why things aren't working. But if the user has
changed eth0 to eth1 in this file in order to get things working again,
it of course needs to be changed back. That should be done somewhere
between the ifdown and the ifup commands. I would probably do it
between the module removal and the module reload.


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
From: Stephen Powell on
On Fri, 29 Jan 2010 02:59:23 -0500, Vincent Lefevre wrote:
> For security reasons, it's better to run commands as
> normal users rather than root.

I tend to be pretty cavalier about that stuff. Some people
go to seed on trying to issue absolutely every possible
command that doesn't require root access as a non-root user.
But to me, that's too much work to keep everything straight.
To me, redefining hardware interfaces is a system
administration task. If I'm doing system administration
work, I become root. And when I'm finished with system
administration work I go back to being an ordinary user
again. The two things that are likely to change my habits
are these:

(1) If I'm on a Linux system, but I do not have system
administration rights, I would, over time, find as many
ways as possible to issue commands that don't ordinarily
work for a non-root user, in order to satisfy my
curiosity with what's going on in the system, or in order
to get my work done.

(2) If I repeatedly get burned by viruses, worms,
etc., I would become paranoid enough to not do anything
as root that I didn't have to do as root.

But since neither is the case right now, I just follow the
simple formula above. Is this a system administration
task? If the answer is yes, I become root. If the
answer is no, I don't.


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org