LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   can't open etc/network/interfaces : permission denied or something? (https://www.linuxquestions.org/questions/linux-newbie-8/cant-open-etc-network-interfaces-permission-denied-or-something-849672/)

arjukjan84 12-11-2010 04:23 AM

can't open etc/network/interfaces : permission denied or something?
 
hi i can't apen etc/network/interfaces file comes some permission denied
what can I do ??

GrapefruiTgirl 12-11-2010 02:05 PM

Please create your own thread for your issue in the future.

I have moved your post to a thread of its own, so that your issue remains separate from that of the creator of the other thread. This makes it easier for LQ members to help each of you.

Now, about your problem: What user are you running as, when you try to open the file? It is extremely likely the file is owned by root, and not readable or editable by a non-root user.

You did not tell us what OS you are using (you should tell us this), but if it's an Ubuntu or Mint type of OS, you probably want to use `sudo`. If it's a different OS (Like RH or CentOS or SuSE maybe), then probably you want to use `su` and become root, then edit the file.

If these ideas fail, then show us the EXACT text, copied from your terminal, when you try to run your editor command, or if you're using some GUI editor, tell us the EXACT error that appears in the dialog box.

stress_junkie 12-11-2010 02:10 PM

Quote:

Originally Posted by arjukjan84 (Post 4187758)
hi i can't apen etc/network/interfaces file comes some permission denied
what can I do ??

If you are typing the path exactly as you typed it here then you are missing the leading / character.
Code:

cat /etc/network/interfaces
Actually that should result in a file not found error unless your were positioned in the root directory.

If you are still having trouble then find out what permissions are on that file.

Code:

ls -lhd /etc
ls -lhd /etc/network
ls -lh /etc/network/interfaces

Post the results here.

And, you should always state which distribution and version you are using. Different distributions have different security settings.

mrgkmn 04-03-2013 09:54 AM

Quote:

Originally Posted by stress_junkie (Post 4188137)
Code:

ls -lhd /etc
ls -lhd /etc/network
ls -lh /etc/network/interfaces

Post the results here.

And, you should always state which distribution and version you are using. Different distributions have different security settings.

i got same error.cant save file.my system is debian

Code:

root@xen:~# ls -lhd /etc
drwxr-xr-x 97 root root 4.0K Apr  3 16:32 /etc
root@xen:~# ls -lhd /etc/network
drwxr-xr-x 7 root root 4.0K Apr  3 16:45 /etc/network
root@xen:~# ls -lh /etc/network/interfaces
-rw-r--r-- 1 root root 347 Apr  3 15:21 /etc/network/interfaces


yancek 04-03-2013 10:13 AM

As explained above, in order to edit/save that file, you need to be logged in as root user.

mrgkmn 04-03-2013 10:35 AM

look that root@xen im logged in root
there is another problem

Madhu Desai 04-03-2013 11:04 AM

Quote:

Originally Posted by arjukjan84 (Post 4187758)
hi i can't apen etc/network/interfaces file comes some permission denied

  1. are you not able to open the file at all, or you can open the file - but cannot save?
  2. are you by any chance trying to edit the file while in rescue mode?

cause once while i was trying to save /etc/fstab while in rescue mode, i could not save file. then i tried this. it solved everything. my distribution is CentOS though

jdkaye 04-03-2013 11:47 AM

Can you post the dialogue from the terminal showing what command you gave and what the system responded with.
jdk

mrgkmn 04-04-2013 06:45 AM

finaly solved
im try this command before editing:

chattr -i /etc/network/interfaces

jdkaye 04-04-2013 11:22 PM

Quote:

Originally Posted by mrgkmn (Post 4924920)
finaly solved
im try this command before editing:

chattr -i /etc/network/interfaces

Then please use the Thread Tools (above your first post) to mark this thread as "solved".
thanks,
jdk

Croock 11-13-2014 05:58 PM

Same problem
 
Hi, I'm having the same problem, but even whit th comand chattr -i /etc/network/interfaces i have the same result.

This is what i got;

omar@aprovisionamiento:~$ su
Contraseņa:
root@aprovisionamiento:/home/omar# whoami
root
root@aprovisionamiento:/home/omar# /etc/network/interfaces
bash: /etc/network/interfaces: Permiso denegado
root@aprovisionamiento:/home/omar#

I tried this;

root@aprovisionamiento:/home/omar# su
root@aprovisionamiento:/home/omar# whoami
root
root@aprovisionamiento:/home/omar# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
#NetworkManager#iface eth0 inet dhcp




x
X
root@aprovisionamiento:/home/omar#

But I don get any information after eth0 inet dhcp

Could someone tell me what I'm doing wrong?

descendant_command 11-13-2014 06:10 PM

Quote:

Could someone tell me what I'm doing wrong?
Tagging on to old and unrelated threads and double-posting...
https://www.linuxquestions.org/quest...an-4175525342/


All times are GMT -5. The time now is 02:36 PM.