LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Hosts not accepted (in dolphin network panel) (https://www.linuxquestions.org/questions/linux-networking-3/hosts-not-accepted-in-dolphin-network-panel-4175541126/)

JZL240I-U 04-29-2015 11:58 AM

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. :mad:

michaelk 04-29-2015 01:33 PM

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.

JZL240I-U 04-30-2015 02:08 AM

Quote:

Originally Posted by michaelk (Post 5355214)
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 (Post 5355214)
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 (Post 5355214)
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 :).

michaelk 04-30-2015 05:45 AM

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@host:port/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@host:path (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"

JZL240I-U 05-06-2015 01:35 AM

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 (Post 5355574)
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 (Post 5355574)
The syntax for a sftp connection is username@host:port/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 (Post 5355574)
As a point of reference the syntax for sftp command line client is
sftp username@host:path (port 22 is the default if different use the -p option)

No password required?

Quote:

Originally Posted by michaelk (Post 5355574)
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".

I want to do it as described in the openSUSE manual, chapter 27.3 (dolphin section):
http://activedoc.opensuse.org/book/o...rans.crossover

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.

michaelk 05-06-2015 06:26 AM

Make sure you can log in using ssh from the command line from each computer.
ssh username@ip_address (password required)

If that works you can try sftp:
sftp username@ip_address

JZL240I-U 05-06-2015 10:23 AM

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?

michaelk 05-06-2015 02:20 PM

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?

JZL240I-U 05-08-2015 11:30 AM

Hmm. Ping:

Code:

me@PC:~> ping 192.168.2.101
connect: Network is unreachable
me@PC:~> ping 192.168.2.101:22
ping: unknown host 192.168.2.101:22
me@PC:~> ping netbook
PING netbook (192.168.2.101) 56(84) bytes of data.
^C {after 3 minutes or so}
--- netbook ping statistics ---
331 packets transmitted, 0 received, 100% packet loss, time 331156ms
me@PC:~>

And here ifconfig:

Code:

PC:/home/me # ifconfig
enp3s0    Link encap:Ethernet  Hardware Adresse 1C:6F:65:31:99:65 
          inet Adresse:169.254.7.42  Bcast:169.254.255.255  Maske:255.255.0.0
          inet6 Adresse: fe80::1e6f:65ff:fe31:9965/64 Gültigkeitsbereich:Verbindung
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:41 errors:0 dropped:0 overruns:0 frame:0
          TX packets:53 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 Sendewarteschlangenlänge:1000
          RX bytes:9194 (8.9 Kb)  TX bytes:9674 (9.4 Kb)

lo        Link encap:Lokale Schleife 
          inet Adresse:127.0.0.1  Maske:255.0.0.0
          inet6 Adresse: ::1/128 Gültigkeitsbereich:Maschine
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:74 errors:0 dropped:0 overruns:0 frame:0
          TX packets:74 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 Sendewarteschlangenlänge:0
          RX bytes:5556 (5.4 Kb)  TX bytes:5556 (5.4 Kb)

ppp0      Link encap:Punkt-zu-Punkt Verbindung 
          inet Adresse:10.33.118.53  P-z-P:10.64.64.64  Maske:255.255.255.255
          UP PUNKTZUPUNKT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:1083 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1425 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 Sendewarteschlangenlänge:3
          RX bytes:683475 (667.4 Kb)  TX bytes:187980 (183.5 Kb)

PC:/home/me #

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 :scratch:. </edit>

michaelk 05-08-2015 12:24 PM

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.

JZL240I-U 05-09-2015 08:51 AM

Quote:

Originally Posted by michaelk (Post 5359710)
...The hosts file does not configure i.e. assign your network adapters an IP address...

Ah, my error.

Quote:

Originally Posted by michaelk (Post 5359710)
...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 :rolleyes:. In YAST2 the functionality is disabled though. One can do it in networkmanager I think / edit connection / edit / Tab &quot;IP-V4&quot; / manual -> new connection (then enter the IP, netmask and gateway)... but I didn't (see below).

Quote:

Originally Posted by michaelk (Post 5359710)
...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 (Post 5359710)
...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.


All times are GMT -5. The time now is 11:04 PM.