NETWORKING – CONNECTING TO SMB 2.0 DEVICE USING CLI

Forum Forums General Tips and Tricks NETWORKING – CONNECTING TO SMB 2.0 DEVICE USING CLI

  • This topic has 3 replies, 2 voices, and was last updated Jul 14-4:53 pm by berghsg.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #86066
    Member
    berghsg

      Greetings

      My OS: Antix 19.1 Marielle Franco
      My Kernel: Linux antix1 4.9.200-antix.1-amd64-smp
      My File Manager: SpaceFM
      My Windows Manager: IceWM
      My Theme: Ultrablack-Large
      My Look and feel: Niroki (dark theme)
      My Icon theme: Numix square antix

      i) PROBLEM

      Trying to connect my antix 19.1 (CLIENT) to a shared folder “Public” on custom ubuntu 20.04 Laptop (SERVER) but you require smb 2.0 protocol
      If you are trying to connect to a PC on local network and connectshares gui is no longer working, for whatever reason, nor is the ‘File > Open URL’ option within SpaceFM working to the smb2.0 PC, instead you get
      “mount error(95): Operation not supported
      Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
      [ Finished ] Press Enter to close:”
      then read on:

      ii) SOLUTION

      Prerequisites
      1) You need to know your sudo passwords on CLIENT and SERVER, created at time of installing your linux OS, and terminal
      to enter commands

      2) cifs must be installed on CLIENT and SERVER
      if not installed, then install it by typing command: sudo apt install cifs-utils

      3) samba is working on SERVER > type following command to confirm: service smbd status
      if not installed, then install it by typing command: sudo apt install samba

      4) Public is shared on SERVER, if no then > type command: sudo pico /etc/samba/smb.conf
      Add in the following under the paragraph [profiles]:
      [Public]
      comment = network share
      browseable = yes
      path = /home/live/Public
      guest ok = yes
      read only = no

      Then save and exit out of pico (text editor) by typing the following commands:
      Ctrl o
      Enter (press Enter key on your keyboard)
      Ctrl x

      Restart smbd
      sudo service smbd restart
      (refer to screenshot antix-forum-smb2.0_1-server….)

      5) samba password / smbpasswd for user is setup on SERVER, where username is ‘live’ (or your own username,
      open terminal and see command prompt, example live@win7-laptop:~) > type the following command: sudo smbpasswd -a live
      enter the password of your choice, re-enter password, example opensaysme.

      6) ip address of SERVER by typing the following command on CLIENT: nbtscan 192.168.1.1-200
      OR
      typing following command on SERVER: ifconfig
      if not installed, then install it by typing command: sudo apt install net-tools
      and reading off the inet number, example 192.168.1.66, listed under enpXX..(or en…) or wlpXX..(or wlan…)

      Commands
      A) Usage: sudo mount.cifs -o username=<user/username on SERVER>,password=<samba password on SERVER>,vers=x.0
      //192.168.x.xxx/<shared samba folder on SERVER>/<mounting point used on CLIENT>

      B) Enter the following example on the CLIENT’s terminal:
      sudo mount.cifs -o username=live,vers=2.0 //192.168.1.66/Public /mnt
      OR
      sudo mount -t cifs -o username=live,vers=2.0 //192.168.1.66/Public /mnt (refer to screenshots antix-forum-
      smb2.0_2b…c..)

      C) Now open SpaceFM on CLIENT > Open a new tab (where the + sign is) > in the address box, where you normally enter the path,
      example /home/live, type: /mnt (refer to screenshot antix-forum-smb2.0_3-client….)
      Enter (press Enter key on your keyboard)
      you should now see the contents in the shared folder ‘Public’ of SERVER

      D) to unmount type the command on the CLIENT’s terminal: sudo umount /mnt

      Other Alternatives
      sudo mount -t cifs -o username=live,password=opensaysme,vers=2.0 //192.168.1.66/Public /mnt
      sudo mount -t cifs -o username=live,password=opensaysme,vers=2.0 //win7-laptop.local/Public /mnt
      where win7-laptop is the name of SERVER obtained by opening terminal on SERVER and reading the prompt, example live@win7-laptop:~

      NOTE:
      for security purposes you may want to leave out “password=opensaysme,” from the mount command and then instead separately type the samba password that is setup on SERVER, after typing in your sudo password that is setup on CLIENT!
      example: sudo mount -t cifs -o username=live,vers=2.0 //192.168.1.66/Public /mnt

      Tips
      While you have the CLIENT connected to SERVER, run the command on SERVER: sudo smbstatus
      (this will confirm the smb protocol that CLIENT’s ip address (will display) is connecting to SERVER’s ip address (example 192.168.1.66). In this exercise the following smb protocol that is displayed is SMB2_02)
      Once you unmount (on CLIENT side) the status will only show the Samba version on SERVER, the rest of the information will go blank.

      Hope this is helpful to some one

      #86091
      Member
      madibi
        Helpful
        Up
        0
        ::

        @berghsg

        Many thanks for the exhaustive and detailed report.
        I encountered the same problem some month ago and after some try I could fix it but I didn’t remember how 🙂

        So now I have another useful bookmark for my next installations.

        m

        #86100
        Member
        berghsg
          Helpful
          Up
          0
          ::

          Refer to screenshot showing the results of the command: smbstatus

          • This reply was modified 9 months, 4 weeks ago by berghsg. Reason: Adding a 5th screenshot
          #86104
          Member
          berghsg
            Helpful
            Up
            0
            ::

            You are most welcome Madibi

            “Paying it forward”

          Viewing 4 posts - 1 through 4 (of 4 total)
          • You must be logged in to reply to this topic.