Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I just started using linux (installed Debian) and the one thing I'm trying to do right now is have my internet working.

I connected my ethernet port but still no internet works. I googled for awhile and figured I had edit the network interfaces config file but I couldn't because it said it was read-only.

I'm not sure how to access that file as a root because I couldn't find an option for that.

Any help in regards with this would be awesome.

share|improve this question
1  
You have root permisions ? –  Jhonathan Oct 12 '12 at 22:13
    
Do you have some desktop environment or you choose text-based minimal installation? What version of Debian have you installed? –  dr. Oct 12 '12 at 22:52
    
Tell us what you have so far by adding the output to sudo ifconfig and sudo netstat-rn and sudo mii-tool to you question. –  jippie Oct 14 '12 at 9:26
add comment

2 Answers 2

Welcome to Linux.

"Root" is an account on your system. When you log in, you can use "root" for the username and then enter the password you specified for root during setup. The root user doesn't have any limitation on privilege and as such can modify any file, run any program, and programs/processes run as root can do anything they want.

Thus it's dangerous to run as root unless you need to, so the usual practice is to have a standard user account for day-to-day use and then elevate to root when needed to perform an administrative action, such as the one you are trying to do. (If you've come from a Windows background, root under Linux lets you be far more destructive to the system than Windows does under an admin account.)

Files also have permissions and owners - permissions are divided into "read", "write" and "execute." There are three sets of these permissions, one for the file owner, one for the group the file belongs to, and one for everyone else. root or the file's owner, or an account that belongs to the "group-owner" can always change permissions of a file. (I won't get into the nuances of permissions here but man chmod is a good starting point for more learning.)

Since the Debian distribution uses /etc/network/interfaces to define network interface information for the ifup and ifdown commands, it's considered important - and therefore protected by only having "read" permission for anyone other than the owner or "group-owner".

So, to get write access to this file, you need to either:

1) login as root on your system and then make the changes you need

2) use a method of running a single command as root - the sudo command makes this rather simple - so a sudo vi /etc/network/interfaces should allow you to edit it, once you enter your password. If you are running a graphical desktop, look for the "Terminal" or "xterm" application.

Check out the Debian wiki for a reference to the options in /etc/network/interfaces: http://wiki.debian.org/NetworkConfiguration

share|improve this answer
add comment

Setting up networking when you are new to Linux and Debian can be very frustrating if it doesn't work out of the box.

First, you need to pinpoint the problem: Is it the driver or the IP configuration?

If your router uses DHCP (automatically assigned IP addresses) you probably just need to assign an IP address to your box as outlined in the other answer, but if it does use DHCP and debian could still not automagically configure it, your network card's driver probably could not be loaded (correctly) and you will need to find out your network card's name, chip and whether it has a driver. To do this you can use the command lspci -k | grep -A 2 Ethernet.

If manually assigning an IP for the device doesn't work you should update your question with the output of that command.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.