I'm trying to share files on home network between two linux machines: host-A is Ubuntu 20.04, host-B is Red Hat. Samba worked well until distr. upgrade to 20.04. Now cifs mount from host-B reports "No route to host". Typical and obvious remedies don't work. sudo ufw status
shows a bunch of ports allowed. I can ping host-A or ping ip of host-A, but cannot connect with gigolo or other smb protocol. Then I tried to set up nfs - same problem. Testing connection from host-B:
nmap host-A
returns 22 tcp open ssh
but when I do
ssh host-A:22
I get " Could not resolve host... Name or service not known" Same with ip address instead of host name.
I know smb or nfs does not use port 22, the above is only to demonstrate that something in firewall is not working the way I understand it should.
I've searched answers but so far this remains a conundrum for me. I must be doing something wrong or missing something. To me it looks like my Ubuntu 20,04 (host-A) can only react to ping in my home network (wireless, 192.168.0.0).
CORRECTION: my test with ssh was incorrectly described. The correct command was ssh host-A
, and host-A did in fact recognize the connection attempt, registered host-B. Then ssh user@host-A
did connect after entering user password. Then I had terminal access to host-A on the host-B machine. Nevertheless, neither samba nor nfs file sharing succeeded despite having ports allowed in ufw. Same error as in my original posting.
ADDITIONAL info based on Answer 1: Outputs of host command on local network targeting Host-B
user@Host-A:~/Desktop$ host Host-B
Host Host-B not found: 2(SERVFAIL)
user@Host-A:~/Desktop$ host 192.168.nnn.mmm
mmm.nnn.168.192.in-addr.arpa domain name pointer Host-B.
user@Host-A:~/Desktop$
If I do vpn on Host-B where it is on mydomain.com
user@Host-A:~/Desktop$ host Host-B.mydomain.com
Host-B.mydomain.com has address xxx.pub.lic.ip
user@Host-A:~/Desktop$
Samba related command outputs:
user@Host-A:~/Desktop$ sudo smbstatus
[sudo] password for user:
Samba version 4.11.6-Ubuntu
PID Username Group Machine Protocol Version Encryption Signing
----------------------------------------------------------------------------------------------------------------------------------------
Service pid Machine Connected at Encryption Signing
---------------------------------------------------------------------------------------------
No locked files
user@Host-A:~/Desktop$ findsmb
*=DMB
+=LMB
IP ADDR NETBIOS NAME WORKGROUP/OS/VERSION
---------------------------------------------------------------------
user@Host-A:~/Desktop$ smbtree
user@Host-A:~/Desktop$
Same in Host-B [userB@Host-B Desktop]$ smbstatus
Samba version 3.6.23-53.el6_10
PID Username Group Machine
-------------------------------------------------------------------
Service pid machine Connected at
-------------------------------------------------------
No locked files
[userB@Host-B Desktop]$ findsmb
*=DMB
+=LMB
IP ADDR NETBIOS NAME WORKGROUP/OS/VERSION
---------------------------------------------------------------------
192.168.nnn.mmm CENTOS [AB] [Unix] [Samba 3.6.23-53.el6_10]
[userB@Host-B Desktop]$ smbtree
Enter userB's password:
[userB@Host-B Desktop]$
More info: Apparently Host-B finds itself in samba and Host-A does not. However, in Host-A (the Ubuntu machine) Browse Network in Thunar does display the netbios name of itself, defined in smb.conf. Yet findsmb command cannot find itself.
It's because Canonical has disabled SMB1 for security reasons. SMB2/SMB3 still works.
smbtree
command also no longer works.Either...
Use //server/pathname or //IP/pathname when using the Connect to Server, or in your /etc/fstab
or
Edit /etc/samba/smb.conf, and add this to the Network section, and restart smbd and nmbd...
Use the
testparm
command to confirm that your smb.conf file is correct.