can't change etc/network/interfaces with sudo or root

Asked by goranubuntu

Hi All,

I'm trying to edit /etc/network/interfaces file with sudo or loging in as root but in both ways i get message permission denied (doesn't allow me to save).

Please help. Not sure why it doesn't give me this permission even if I try with sudo or root :/

thanks in advance

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
goranubuntu
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

When you use sudo, the command is ran as root. The system doesn't know the difference.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#2

If you run:

sudo nano /etc/network/interfaces

Can you edit the file ok there?
Is the partition with the file on mounted as writable?
what is the output of:

lsb_release -a; uname -a; mount

Thanks

Revision history for this message
goranubuntu (grbravo1) said :
#3

i tryed sudo nano and it doesn allow me to save. it says permission denied. (when i run gksudo nautilus and go to this folder there is a lock on the icon of network/interfaces, maybe this could be the problem)

here is the output of lsb_release -a; uname -a; mount:

goran@goran-laptop:~$ lsb_release -a; uname -a; mount
LSB Version: core-2.0-ia32:core-2.0-noarch:core-3.0-ia32:core-3.0-noarch:core-3.1-ia32:core-3.1-noarch:core-3.2-ia32:core-3.2-noarch:core-4.0-ia32:core-4.0-noarch:core-4.1-ia32:core-4.1-noarch:security-4.0-ia32:security-4.0-noarch:security-4.1-ia32:security-4.1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 14.04 LTS
Release: 14.04
Codename: trusty
Linux goran-laptop 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:08:14 UTC 2014 i686 i686 i686 GNU/Linux
/dev/sda1 on / type ext4 (rw,errors=remount-ro,user_xattr)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/cgroup type tmpfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
none on /sys/fs/pstore type pstore (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd)
gvfsd-fuse on /run/user/0/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=goran)
gvfsd-fuse on /home/goran/.gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev)
goran@goran-laptop:~$ ^C
goran@goran-laptop:~$

Revision history for this message
goranubuntu (grbravo1) said :
#4

here is alos output of ls -l (it seems to me all files in etc/network are editable except this interfaces file :(

root@goran-laptop:~# ls -l /etc/network
total 24
drwxrwxr-x 2 root root 4096 Apr 20 20:04 if-down.d
drwxrwxr-x 2 root root 4096 Apr 20 18:55 if-post-down.d
drwxrwxr-x 2 root root 4096 Apr 20 19:50 if-pre-up.d
drwxrwxr-x 2 root root 4096 Apr 20 20:04 if-up.d
-rw-r--r-- 1 root root 163 Jul 22 2012 interfaces
drwxrwxr-x 2 root root 4096 Sep 16 2013 interfaces.d
lrwxrwxrwx 1 root root 12 Nov 19 23:47 run -> /run/network
root@goran-laptop:~#

Revision history for this message
goranubuntu (grbravo1) said :
#5

sudo chmod 777 /etc/network/interfaces solved my problem

All the best