Sign in with
Sign up | Sign in
Your question

Linux newbie command line error

Last response: in Linux/Free BSD
Share
January 22, 2012 10:40:20 PM

I am doing a weekend project where I have to "configure your LAN Ethernet address to 192.168.1.100"
The instructions say to put "ifconfig eth0 192.168.1.100" to do this, but when I do I get is
"SIOCSIFADDR: Permission denied
SIOCSIFFLAGS: Permission denied"
what am I doing wrong?
a b 5 Linux
January 22, 2012 11:00:05 PM

Make sure you are root when you use ifconfig you are root.

Login as root:
  1. su
  2. <type password>
  3. ifconfig eth0 192.168.1.100
m
0
l
January 22, 2012 11:14:27 PM

amdfangirl said:
Make sure you are root when you use ifconfig you are root.

Login as root:
  1. su
  2. <type password>
  3. ifconfig eth0 192.168.1.100
I just tried that, but it says "su authentification failer" I have no doubt that your instructions were correct, but now I have this problem. I changed my password and then tried the new one, but the same message came up.

Update: I should have googled this new problem first, I get how to do it now.
m
0
l
Related resources
January 22, 2012 11:23:12 PM

sudo su

Then enter your password. If you are not set up as a wheel user and you can't remember the root password you entered, then you may have to re-install.

You can also enter

sudo ifconfig eth0 192.168.1.100

If you don't want to reset the root password, and just want to use the command.
m
0
l
a b 5 Linux
January 23, 2012 12:15:55 AM

totalknowledge said:
sudo su

Then enter your password. If you are not set up as a wheel user and you can't remember the root password you entered, then you may have to re-install.

You can also enter

sudo ifconfig eth0 192.168.1.100

If you don't want to reset the root password, and just want to use the command.


The use of sudo would depend on the use of the /etc/sudoers file. Eg. Using sudo will work with stock Ubuntu as "user" but not in stock Fedora as "user".

Quote:
Unlike the su command, users typically supply their own password to sudo. After authentication, and if the /etc/sudoers configuration file permits the user access, then the system will invoke the requested command. By default the user's password can be retained through a grace period (15 minutes per pseudo terminal), allowing the user to execute several successive commands as the requested user without having to provide a password again.

sudo is able to log each command run. Where a user attempts to invoke sudo without being listed in the sudoers file an error is presented to the user indicating that the attempt has been recorded in the system log.


http://en.wikipedia.org/wiki/Sudo
m
0
l
January 23, 2012 12:39:00 AM

Or if they checked the box on the Fedora install that adds them to the wheel group.
m
0
l
a b 5 Linux
January 23, 2012 1:16:27 AM

Depends if they do or not. :) 

We don't know how the OP has configured his system.
m
0
l
a b 5 Linux
January 23, 2012 5:51:10 AM

And the use of "su" requires you to know the password for root. Swings and roundabouts.

If I want to do a number of commands as root I use "sudo bash".

For single commands I think "sudo" is to be preferred. That way you only have root priviliges for the one command, which is safer.
m
0
l
a b 5 Linux
January 23, 2012 6:35:48 AM

su -c

anyone?
m
0
l
a b 5 Linux
January 23, 2012 9:09:19 AM

Well, that's just like "sudo" except you need to know the root password. With "sudo" you only need to know your own password.
m
0
l
January 24, 2012 1:16:15 AM

Ijack said:
Well, that's just like "sudo" except you need to know the root password. With "sudo" you only need to know your own password.

Assuming it is set up that way. Depending on how it is set up, you may have to supply your password, the root password, or it might not work at all.
m
0
l
a b 5 Linux
January 24, 2012 1:25:32 AM

That is true (although most distros I have tried set it up that way). It is also easy with sudo to limit the capabilites of the rooted account.
m
0
l
January 24, 2012 1:31:29 AM

Yes, most have it set up that way, assuming they have it set up by default. Back when I used Fedora (12 was the latest), it required the root password unless you set it up otherwise.
m
0
l
!