0

I'm trying to run a Samba server installed in an Alpine Linux 3.7.0(Vanilla) inside VirtualBox and trying to access that from my Windows 10 host which is part of a domain. Here are the links that I tried to use to mitigate the problem but neither of them worked, hence I'm forced to ask this question again.

My Windows 10 box is part of a domain called XX. My Windows domain username is XX\SuperCoolUser.

I've installed Samba with the help of this article.

I've tried both

  • smbpasswd -a root
  • adduser SuperCoolUser and then smbpasswd -a SuperCoolUser

Both don't work.

/etc/samba/smb.conf

[global]
   log file = /var/log/samba/log.%m
   max log size = 50
   workgroup = XX
   server string = Samba Server %v
   netbios name = dev-1
   security = user
   map to guest = bad user
   dns proxy = no
   username map = /etc/samba/smbusers

[storage]
   path = /media/storage
   browsable = yes
   writeable = yes
   guest ok = yes

/etc/samba/smbusers -

# Unix_name = SMB_name1 SMB_name2 ...
root = SuperCoolUser

When I run smbclient -L localhost -U% then this the output

Sharename       Type      Comment
---------       ----      -------
storage         Disk
IPC$            IPC       IPC Service (Samba Server 4.7.3)
Reconnecting with SMB1 for workgroup listing.

Server               Comment
---------            -------

Workgroup            Master
---------            -------
XX                   DEV-1

My virtual machine has two adapters

  • Bridged(DHCP) for internet
  • Host-only(Static) for SSH and file sharing(Samba)

Note: I'm able to ssh into the machine and run commands, so its network visible.


Edit

If I run the command smbclient -L 192.168.56.131 -U samba@samba where samba is the foo user.

I get the following output

Enter samba@samba's password:

Sharename       Type      Comment
---------       ----      -------
storage         Disk
IPC$            IPC       IPC Service (Samba Server 4.8.2)
Reconnecting with SMB1 for workgroup listing.

Server               Comment
---------            -------

Workgroup            Master
---------            -------
XX                   DEV-1

Notice the server section is empty. Does that mean my service is not running?

1

Using your given structure, but modified a bit:

  • in smbusers i'm not using root for user mapping, but a simple local user foo:

    • foo = SuperCoolUser
  • in smb.conf guest ok = no (to prevent invalid users from accessing the share).

I'm able to access the share from Windows host with following steps:

  1. on Linux guest create the user foo (if not already created)

    • adduser foo (i.e. password "bar")
  2. on Linux guest create samba user with same name and password as linux user:

    • smbpasswd -a foo (password "bar")
    • pdbedit -L (checking if foo was created successfully)
  3. on Windows host open cmd and run:

    • net use Z: \\192.168.56.200\storage /user:SuperCoolUser /persistent:no
    • as password input "bar"
    • message: "The command completed successfully"

Now you can list files on your share with dir Z:

  • When you say foo = SuperCoolUser do you mean the user that I use to login to windows? – Soham Dasgupta May 23 '18 at 12:18
  • I'm getting this error sadly from windows System error 53 has occurred. The network path was not found. – Soham Dasgupta May 23 '18 at 12:28
  • did you replace my ip address with the address of your linux guest? – alzaj May 23 '18 at 12:33
  • 1
    the error 53 is not related to samba. you told the TCP connection from host to guest is all right. To make it sure, you can try to test it with i.e. Powershell command: Test-NetConnection -ComputerName 192.168.56.200 -Port 445 -InformationLevel "Detailed" – alzaj May 23 '18 at 12:47
  • 1
    On the linux guest you can select what port the samba server uses, but you can't force windows to access samba shares on ports different than 445 or 139. – alzaj May 23 '18 at 13:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.