Linux newbie command line error

Dan2013

Distinguished
Feb 24, 2011
24
0
18,510
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?
 

Dan2013

Distinguished
Feb 24, 2011
24
0
18,510
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.
 

totalknowledge

Distinguished
Jul 8, 2011
540
0
19,010
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.
 

amdfangirl

Expert
Ambassador


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".

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
 
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.
 

PreferLinux

Distinguished
Dec 7, 2010
1,023
0
19,460

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.