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 Answers1

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:

alzaj
  • 46
  • 4