Download the Tom's Hardware App from the App Store
The reference for current tech news
Yes No
Ads
Tom's Hardware > Forum > Linux/Free BSD > General Discussion > Linux newbie command line error

Linux newbie command line error

Forum Linux/Free BSD : General Discussion Linux newbie command line error

Word :    Username :           
 

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?

Reply to Dan2013
Register or log in to remove.

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

 

Login as root:

Code :
  1. su
  2. <type password>
  3. ifconfig eth0 192.168.1.100

Message quoted 1 times
Message edited by amdfangirl on 01-23-2012 at 02:00:34 AM
------------------------------ Dying
Is an art, like everything else.
I do it exceptionally well.
-Slyvia Plath Lady Lazarus
Reply to amdfangirl

amdfangirl wrote :

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

Login as root:

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


Message edited by Dan2013 on 01-23-2012 at 02:24:10 AM
Reply to Dan2013

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.

Message quoted 1 times
Message edited by totalknowledge on 01-23-2012 at 02:24:32 AM
Reply to totalknowledge

totalknowledge wrote :

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

------------------------------ Dying
Is an art, like everything else.
I do it exceptionally well.
-Slyvia Plath Lady Lazarus
Reply to amdfangirl

Or if they checked the box on the Fedora install that adds them to the wheel group.

Reply to totalknowledge

Depends if they do or not. :)

We don't know how the OP has configured his system.

------------------------------ Dying
Is an art, like everything else.
I do it exceptionally well.
-Slyvia Plath Lady Lazarus
Reply to amdfangirl

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.

Reply to Ijack

su -c

anyone?

------------------------------ Dying
Is an art, like everything else.
I do it exceptionally well.
-Slyvia Plath Lady Lazarus
Reply to amdfangirl

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

Reply to Ijack

Ijack wrote :

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.

------------------------------ i5 2500K, GA-P67A-UD3R, 12 GB RAM, 1 TB Spinpoint F3 & 250 GB WD HDDs, DVD writer, Dell U2311H 23", Philips 170B6 17" & Philips 150B4 15" monitors, Dvorak keyboard, openSUSE 11.4 with Windows Vista Ultimate in a VB VM.

Rom. 3:23; 6:23; 5:8; 10:9-10,13
Reply to PreferLinux

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.

Reply to Ijack

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.

------------------------------ i5 2500K, GA-P67A-UD3R, 12 GB RAM, 1 TB Spinpoint F3 & 250 GB WD HDDs, DVD writer, Dell U2311H 23", Philips 170B6 17" & Philips 150B4 15" monitors, Dvorak keyboard, openSUSE 11.4 with Windows Vista Ultimate in a VB VM.

Rom. 3:23; 6:23; 5:8; 10:9-10,13
Reply to PreferLinux
Register or log in to remove.
Tom's Hardware > Forum > Linux/Free BSD > General Discussion > Linux newbie command line error
Go to:

There are 1939 identified and unidentified users. To see the list of identified users, Click here.

  • Ask the community now
  • Publish
Ad
Ads
Latest best answer
Dual Boot Windows 7 and Ubuntu 12.04
By ijack, 4 days ago:

To get the best performance and lifetime from your SSD you should plan a little more...

Best offers
They won a badge
Join us in greeting them
Top experts