[SOLVED] Hosts not accepted (in dolphin network panel)
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Rep:
Hosts not accepted (in dolphin network panel)
I'm new to networking.
I try to connect my pc and my netbook. Edited /etc/hosts on both machines adding identical lines like this
Code:
...
192.198.2.100 PC PC
192.168.2.101 netbook netbook
...
On the PC dolphin shows in the tab "places / network" an entry "netbook". Clicking on that it tries to connect with an address like this
Code:
sftp://me@192.168.2.101:22/home/me/
Where does it get the "/home/me/ part from? Or the "me@" by the way?
Why not sftp://me:password...
I read that the sftp port should be 115 (not the 22 of ftp) by the way...
Part two of my woes follows right here:
On the netbook dolphin shows in the tab "places / network" no entry "PC" at all, even after a reboot. Doesn't /etc/hosts get read? What the... Why? What is going on?
I looked at the firewalls, both machines have identical (default) settings.
I'm aware that alls this has (a) perfectly simple reason(s) but I simply can't figure it (them) out. Grrrr.
sftp runs over ssh which uses 22 as its default port and ftp uses port 21. Simple file transfer protocol uses port 115 which is not the same thing as sftp. The purpose of the hosts file is basically a manual way to resolve host names to IP addresses.
I assume by connect you want to share files between the two computers. The typical methods / protocols used are nfs, sftp and samba i.e CIFS/SMB (windows networking). Those desired services must be running on your PCs as well as the firewall allowing access to those ports. If samba or windows PCs are not running then network places will be empty.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Quote:
Originally Posted by michaelk
sftp runs over ssh which uses 22 as its default port and ftp uses port 21. Simple file transfer protocol uses port 115 which is not the same thing as sftp.
Confusing... What does "sftp" stand for, then?
Quote:
Originally Posted by michaelk
The purpose of the hosts file is basically a manual way to resolve host names to IP addresses.
I know, but why is "netbook" known to "PC" but not vice versa with identical hosts files?
Quote:
Originally Posted by michaelk
I assume by connect you want to share files between the two computers. The typical methods / protocols used are nfs, sftp and samba i.e CIFS/SMB (windows networking). Those desired services must be running on your PCs as well as the firewall allowing access to those ports. If samba or windows PCs are not running then network places will be empty.
I have not real network, just two computers and a cable, nothing sophisticated is called for.
On "PC" everything seems to be fine, dolphin tries to connect -- with a timeout. The address / URI "sftp://me@192.168.2.101:22/home/me/" is correct, as far as I can see.
Can you please have a look at the questions after the second [CODE] block in my original post, perhaps you know some answers there -- thanks in advance .
sftp - secure file transfer protocol. "sftp://me@192.168.2.101:22/home/me/" a timeout would indicate that either ssh is not running or the firewall is not configured to allow ssh traffic or ssh is configured to run on a different port (not 22) on the laptop. The syntax for a sftp connection is username@hostort/path. I don't know why you have already have a saved shortcut unless you unknowingly saved it. The file browser uses sftp:// to indicate the protocol/connection type.
As a point of reference the syntax for sftp command line client is
sftp username@hostath (port 22 is the default if different use the -p option)
You have not specified as to what you mean by "connect". As stated in my first post some type of service needs to be running on both computers. Again some of the methods for file sharing is samba, nfs or sftp. The network in the file browser is typically for windows / samba shares. The other protocols are not "browseable"
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Hello michaelk, sorry to be back only this late, but I was out of town for a few days and then my connection was down due to bad weather...
Quote:
Originally Posted by michaelk
sftp - secure file transfer protocol. "sftp://me@192.168.2.101:22/home/me/" a timeout would indicate that either ssh is not running or the firewall is not configured to allow ssh traffic or ssh is configured to run on a different port (not 22) on the laptop.
I checked: sshd is running, ports are open on 22. So that is not the reason.
Quote:
Originally Posted by michaelk
The syntax for a sftp connection is username@hostort/path. I don't know why you have already have a saved shortcut unless you unknowingly saved it. The file browser uses sftp:// to indicate the protocol/connection type.
I found out, it is from the olden times when I used openSUSE 12.3. Then it worked *sigh*.
Quote:
Originally Posted by michaelk
As a point of reference the syntax for sftp command line client is
sftp username@hostath (port 22 is the default if different use the -p option)
No password required?
Quote:
Originally Posted by michaelk
You have not specified as to what you mean by "connect". As stated in my first post some type of service needs to be running on both computers. Again some of the methods for file sharing is samba, nfs or sftp. The network in the file browser is typically for windows / samba shares. The other protocols are not "browseable".
Something in the connection doesn't seem to work, though networkmanager sees it and labels it running/connected. How can I check whether the "connection is established" as demanded in the openSUSE manual?
I have no windows I just want to connect two machines running under openSUSE 13.2 / KDE using a simple cable. All the powerful features of nfs or samba are not really necessary as far as I understand it.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Okay:
Code:
me@PC:~> ssh me@192.168.2.101:22/home/me
ssh: Could not resolve hostname 192.168.2.101:22/home/me: Name or service not known
me@PC:~> ssh me@192.168.2.101
ssh: connect to host 192.168.2.101 port 22: Connection timed out
me@PC:~> cat /etc/hosts
#
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server.
# Syntax:
#
# IP-Address Full-Qualified-Hostname Short-Hostname
#
127.0.0.1 localhost
# special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback
fe00::0 ipv6-localnet
ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
192.168.2.100 PC PC
192.168.2.101 netbook netbook
# 0.0.0.0 navigator.web.de
me@PC:~>
So the error is the same as in the GUI, i.e. "timeout" of the connection. Or did I do anything the wrong way?
If the computers are connected using just an ethernet cable have you verified that networking is configured correctly?
Can you ping the other computer using the ping command?
ping pc or ping netbook (depending on which computer you type the command).
Look at the output of the ifconfig command, is the ethernet adapter actually assigned an IP address?
So, network unreachable, funny IP-address assigned (by whom?). So I tried that address:
Code:
me@PC:~> ping 169.254.11.166
PING 169.254.11.166 (169.254.11.166) 56(84) bytes of data.
64 bytes from 169.254.11.166: icmp_seq=1 ttl=64 time=1.47 ms
64 bytes from 169.254.11.166: icmp_seq=2 ttl=64 time=0.729 ms
64 bytes from 169.254.11.166: icmp_seq=3 ttl=64 time=0.735 ms
64 bytes from 169.254.11.166: icmp_seq=4 ttl=64 time=0.730 ms
64 bytes from 169.254.11.166: icmp_seq=5 ttl=64 time=0.741 ms
64 bytes from 169.254.11.166: icmp_seq=6 ttl=64 time=0.716 ms
64 bytes from 169.254.11.166: icmp_seq=7 ttl=64 time=0.712 ms
64 bytes from 169.254.11.166: icmp_seq=8 ttl=64 time=0.750 ms
64 bytes from 169.254.11.166: icmp_seq=9 ttl=64 time=0.726 ms
64 bytes from 169.254.11.166: icmp_seq=10 ttl=64 time=0.701 ms
64 bytes from 169.254.11.166: icmp_seq=11 ttl=64 time=0.731 ms
64 bytes from 169.254.11.166: icmp_seq=12 ttl=64 time=0.705 ms
64 bytes from 169.254.11.166: icmp_seq=13 ttl=64 time=0.697 ms
64 bytes from 169.254.11.166: icmp_seq=14 ttl=64 time=0.725 ms
64 bytes from 169.254.11.166: icmp_seq=15 ttl=64 time=0.698 ms
64 bytes from 169.254.11.166: icmp_seq=16 ttl=64 time=0.708 ms
64 bytes from 169.254.11.166: icmp_seq=17 ttl=64 time=0.714 ms
64 bytes from 169.254.11.166: icmp_seq=18 ttl=64 time=0.701 ms
64 bytes from 169.254.11.166: icmp_seq=19 ttl=64 time=0.701 ms
64 bytes from 169.254.11.166: icmp_seq=20 ttl=64 time=0.702 ms
64 bytes from 169.254.11.166: icmp_seq=21 ttl=64 time=0.690 ms
64 bytes from 169.254.11.166: icmp_seq=22 ttl=64 time=0.678 ms
64 bytes from 169.254.11.166: icmp_seq=23 ttl=64 time=0.671 ms
64 bytes from 169.254.11.166: icmp_seq=24 ttl=64 time=0.676 ms
64 bytes from 169.254.11.166: icmp_seq=25 ttl=64 time=0.671 ms
64 bytes from 169.254.11.166: icmp_seq=26 ttl=64 time=0.687 ms
^C
--- 169.254.11.166 ping statistics ---
26 packets transmitted, 26 received, 0% packet loss, time 25001ms
rtt min/avg/max/mdev = 0.671/0.737/1.472/0.149 ms
me@PC:~>
Umm. Do I use these IPs? Do they change? How are they assigned? Why are the /etc/hosts files ignored?
Btw. the same works on the netbook (with IP 169.254.7.42, which belongs to PC ... *sigh*). What do you suggest now?
<edit> Okay, I tried it. It works after getting rid of a popup, saying that the authenticity of the computer "netbook" could not be established. Yes. Ummm. Bewildering . </edit>
The hosts file resolves IP addresses to a name. So when you type in PC in the browser for example it actually uses 192.198.2.100. The hosts file does not configure i.e. assign your network adapters an IP address. How to do that depends on the distribution. You need to assign each PC with a static IP address. The how to depends on the distribution but most have a GUI wizard if running a desktop.
If a computer does not have a permanent IP address i.e static then in most cases they are assigned one automatically via a DHCP server i.e. from a home router or an ISP. When the computer boots up the DHCP client requests an IP address from the server. If a server does not respond then the client has a fail over mode whereby it assigns itself an unused private address in the range 169.254.0.0/16.
So yes you can use the 169.254.x.x addresses but they might change every time the computer is started.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
Quote:
Originally Posted by michaelk
...The hosts file does not configure i.e. assign your network adapters an IP address...
Ah, my error.
Quote:
Originally Posted by michaelk
...You need to assign each PC with a static IP address. The how to depends on the distribution but most have a GUI wizard if running a desktop.
OpenSUSE has at least two . In YAST2 the functionality is disabled though. One can do it in networkmanager I think / edit connection / edit / Tab "IP-V4" / manual -> new connection (then enter the IP, netmask and gateway)... but I didn't (see below).
Quote:
Originally Posted by michaelk
...If a computer does not have a permanent IP address i.e. static then in most cases they are assigned one automatically via a DHCP server...
That's no solution here, since this is only two computers and a cable .
Quote:
Originally Posted by michaelk
...If a [DHCP] server does not respond then the client has a fail over mode whereby it assigns itself an unused private address in the range 169.254.0.0/16.
So yes you can use the 169.254.x.x addresses but they might change every time the computer is started.
They don't change. So I'll just use them. I just wish I knew how they were assigned.
Thank you for your help and patience, michaelk I'll mark this thread as solved now.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.