LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Fedora 31 - Unable to connect Samba share (https://www.linuxquestions.org/questions/linux-newbie-8/fedora-31-unable-to-connect-samba-share-4175666489/)

ddenial 12-24-2019 10:26 AM

Fedora 31 - Unable to connect Samba share
 
Hello All

For learning, just installed Samba share in Fedora 31 and I'm unable to list samba home share as smbclient. I get error 'SMB1 disabled -- no workgroup available'

Code:

$ smbclient -L smb.nix.lan -U atom
Enter SAMBA\atom's password:

        Sharename      Type      Comment
        ---------      ----      -------
        print$          Disk      Printer Drivers
        IPC$            IPC      IPC Service (Samba Server 4.11.4 in smb.nix.lan.)
        atom            Disk      Home Directories
SMB1 disabled -- no workgroup available

My config file:
Code:

$ cat /etc/samba/smb.conf
[global]
        workgroup = SAMBA
        security = user
        server string = Samba Server %v in smb.nix.lan.
        netbios name = SMB-NIX-LAN
        wins support = yes

        interfaces = lo enp3s0
        hosts allow = 192.168.1.0/24 192.168.122.0/24

        acl allow execute always = True
        passdb backend = tdbsam

        printing = cups
        printcap name = cups
        load printers = yes
        cups options = raw

        log file = /var/log/samba/log.%m
        max log size = 50

[homes]
        comment = Home Directories
        valid users = %S, %D%w%S
        browseable = No
        read only = No
        inherit acls = Yes

[printers]
        comment = All Printers
        path = /var/tmp
        printable = Yes
        create mask = 0600
        browseable = No

[print$]
        comment = Printer Drivers
        path = /var/lib/samba/drivers
        write list = @printadmin root
        force group = @printadmin
        create mask = 0664
        directory mask = 0775

Some websites say Fedora 31 has disabled SMB1 by default and only allow SMB3. But I don't know what update I should do in my config file to work.

Any assistance is much appreciated.

Thanks

ferrari 12-24-2019 01:07 PM

Yes, SMBv1 has been recognised as a major security risk for some time now and now inhibited by default. It should be avoided completely if at all possible, even if that means upgrading any legacy samba servers and hosts in a given LAN environment. However, for some private users with old hardware (eg NAS with samba shares) it may be necessary to force SMBv1 (even if only on a temporary basis). When that is deemed necessary, add the following entry to smb.conf ([global] section)...

Code:

client min protocol = NT1
There are lots of threads and bug reports if you care to search online. For example
https://bugzilla.redhat.com/show_bug.cgi?id=1768117
https://ask.fedoraproject.org/t/fedo...shares/4038/32

ddenial 12-24-2019 01:43 PM

Quote:

Originally Posted by ferrari (Post 6071032)
Yes, SMBv1 has been recognised as a major security risk for some time now and now inhibited by default. It should be avoided completely if at all possible, even if that means upgrading any legacy samba servers and hosts in a given LAN environment. However, for some private users with old hardware (eg NAS with samba shares) it may be necessary to force SMBv1 (even if only on a temporary basis). When that is deemed necessary, add the following entry to smb.conf ([global] section)...

Code:

client min protocol = NT1
There are lots of threads and bug reports if you care to search online. For example
https://bugzilla.redhat.com/show_bug.cgi?id=1768117
https://ask.fedoraproject.org/t/fedo...shares/4038/32

Unfortunately not working for me.

Code:

# smbclient -L //smb.nix.lan -U atom
Enter SAMBA\atom's password:

        Sharename      Type      Comment
        ---------      ----      -------
        print$          Disk      Printer Drivers
        IPC$            IPC      IPC Service (Samba Server 4.11.4 in smb.nix.lan.)
        atom            Disk      Home Directories
Reconnecting with SMB1 for workgroup listing.
smbXcli_negprot_smb1_done: No compatible protocol selected by server.
protocol negotiation failed: NT_STATUS_INVALID_NETWORK_RESPONSE
Unable to connect with SMB1 -- no workgroup available

I read tagged links, but in all examples, some NAS have a problem connecting to the SMB server. In my case, both the Server and Client are the same machine (Fedora 31). Still, I'm getting an error.

michaelk 12-24-2019 03:02 PM

Code:

Sharename      Type      Comment
---------      ----      -------
atom            Disk      Home Directories

This is your samba home share. Without smb1 it won't pop up under network in your file browser but it can be directly accessed. [homes] is a special share where users with home directories are automatically created as shares with their username.

ferrari 12-24-2019 03:13 PM

Does it work if you do this instead?
Code:

smbclient -m SMB2 -d 10 -L //smb.nix.lan -U atom

ferrari 12-24-2019 03:19 PM

As michaelk mentioned (and due to SMBv1 now completely disabled) you can still access the shares directly eg file browser using
'smb://smb.nix.lan' or specify user with something like 'smb://<user>@smb.nix.lan'

ddenial 12-24-2019 03:56 PM

Quote:

Originally Posted by ferrari (Post 6071063)
Does it work if you do this instead?
Code:

smbclient -m SMB2 -d 10 -L //smb.nix.lan -U atom

Nope

ddenial 12-24-2019 04:00 PM

So now I tried this, it will connect.

Code:

$ smbclient //smb.nix.lan/atom -U atom
Enter SAMBA\atom's password:
Try "help" to get a list of possible commands.
smb: \> ls
  .                                  D        0  Tue Dec 24 20:46:56 2019
  ..                                  D        0  Tue Dec 24 18:30:32 2019
  Desktop                            D        0  Tue Dec 24 20:45:07 2019
  .mozilla                          DH        0  Thu Oct 24 04:42:09 2019
  Templates                          D        0  Tue Dec 24 20:45:07 2019
  .bash_profile                      H      141  Fri Dec  6 17:36:53 2019
  Videos                              D        0  Tue Dec 24 20:45:07 2019
  .bash_logout                        H      18  Fri Dec  6 17:36:53 2019
  .bashrc                            H      376  Fri Dec  6 17:36:53 2019
  .local                            DH        0  Tue Dec 24 20:45:07 2019
  .bash_history                      H      73  Tue Dec 24 20:46:56 2019
  Public                              D        0  Tue Dec 24 20:45:07 2019
  .cache                            DH        0  Tue Dec 24 20:45:38 2019
  .config                            DH        0  Tue Dec 24 20:46:59 2019
  Music                              D        0  Tue Dec 24 20:45:07 2019
  Pictures                            D        0  Tue Dec 24 20:45:07 2019
  Documents                          D        0  Tue Dec 24 20:45:07 2019
  Downloads                          D        0  Tue Dec 24 20:45:07 2019
  .esd_auth                          H      16  Tue Dec 24 20:45:07 2019

                205375464 blocks of size 1024. 179438528 blocks available
smb: \>

I guess I won't be able to list shares in the terminal from now on then. Hmmm.

michaelk 12-24-2019 05:25 PM

Quote:

I guess I won't be able to list shares in the terminal from now on then. Hmmm.
From the file browser not the terminal. Although avahi is supposed to find shares between linux computers which should be installed.


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