Mailinglist Archive: opensuse (1165 mails)

< Previous Next >
Re: [opensuse] localhost unknown host SOLVED
Hans-Joachim Ehlers wrote:
Could you check why you get on /etc/hosts a permission denied ?

open("/etc/hosts", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)

Strange... /etc/hosts was a symbolic link to another file in /etc/hosts format.

I removed the link (rm /etc//hosts) and then copied the file to which it was
to /etc/hosts and everything works now.

Thanks Hans.

root@linux-c4zg:/etc> ls -al hosts
lrwxrwxrwx 1 root root 7 Jan 14 13:28 hosts -> hosts.2

# that's peculiar

root@linux-c4zg:/etc> ls -al hosts.2
-rw-r--r-- 1 root root 1910 Feb 26 00:00 hosts.2

# readable by everyone and writable only by root, as it should be
# remove link and replace it with an actual file.

root@linux-c4zg:/etc> rm hosts ; cp hosts.2 hosts
root@linux-c4zg:/etc> ping localhost
PING localhost ( 56(84) bytes of data.
64 bytes from localhost ( icmp_seq=1 ttl=64 time=0.064 ms
64 bytes from localhost ( icmp_seq=2 ttl=64 time=0.068 ms
64 bytes from localhost ( icmp_seq=3 ttl=64 time=0.079 ms
--- localhost ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 0.064/0.070/0.079/0.009 ms

To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >