View Full Version : [SOLVED] Installing Samba
torbentf
February 5th, 2022, 06:15 PM
Hi,
I am trying to install samba on Ubuntu 20.04 on a workstation using the instructions on:
https://ubuntu.com/tutorials/install-and-configure-samba#4-setting-up-user-accounts-and-connecting-to-share
They are supposed to apply to Ubuntu 16.04 and a server. Does it matter?
I got to the point where:
"On Windows, open up File Manager and edit the file path to:
\\ip-address\sambashare
Note: ip-address is the Samba server IP address and sambashare is the name of the share.
You’ll be prompted for your credentials. Enter them to connect!"
I have opened Windows File Manager and the only place where I can see a file path to be filled in is where it says "Network>" and I have filled in with 192.168.110.19 (which I think is the address of my Linux machine)and pressed Enter. Then nothing happens.
Can anyone tell me what went wrong here?
Best regards
torben
TheFu
February 5th, 2022, 06:50 PM
Samba has changed drastically since 20.04 due to changes both in samba and the most common clients (Win10) altering their default settings. Also, MSFT has changed how network services are located. "Browsing the network" doesn't work. Though the guide you followed is fine for everything except where it suggested sharing files. Don't share files under any user's HOME.
If you don't have the correct IP address for the server, nothing will work. Servers should always have static IPs that are known.
For troubleshooting samba, run testparm on the samba server and post the results here. Someone should see the issues. The entire config should show up. If it doesn't, then I think the setup is incorrect. There are other ways that claim to work for setting up samba, but they seem to just cause problems.
Making any CIFS/Samba share underneath a user's HOME directory is asking for problems. Put shared files elsewhere OR use the [homes] samba option instead. That will share the HOME directories for each uesrid once the smbpasswd -a command is run for each userid.
The format of the [homes] is this:
[homes]
comment = Home Directories
create mask = 0644
read only = No
valid users = %S
wide links = Yes
Add that to the bottom of the smb.conf file, restart samba.
Morbius1
February 5th, 2022, 06:55 PM
289968
Is that what you did?
And please tell us how you are using this samba share.
Is it to be used as a central samba server for all other systems to access where a [homes] share may or may not make sense? Or is it for you to share one folder with others on the local network.
torbentf
February 6th, 2022, 10:08 AM
Hi TheFu,
Thank you for your answer. It has apparently advanced me:
Torben@torben-Aspire-E5-773G:/etc/samba$ testparm
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Weak crypto is allowed
WARNING: The 'netbios name' is too long (max. 15 chars).
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
# Global parameters
[global]
bind interfaces only = Yes
log file = /var/log/samba/log.%m
logging = file
map to guest = Bad User
max log size = 1000
obey pam restrictions = Yes
pam password change = Yes
panic action = /usr/share/samba/panic-action %d
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
passwd program = /usr/bin/passwd %u
server role = standalone server
server string = %h server (Samba, Ubuntu)
unix password sync = Yes
usershare allow guests = Yes
workgroup = SAMBATF
idmap config * : backend = tdb
[printers]
browseable = No
comment = All Printers
create mask = 0700
path = /var/spool/samba
printable = Yes
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
[homes]
comment = Home Directories
create mask = 0644
read only = No
valid users = %S
wide links = Yes
torben@torben-Aspire-E5-773G:/etc/samba$
Here is the answer I get from Windows:
"You cant get access to \\192.168.110.19\sambashare"
and when I press diagnostics I get:
"check that sambashare is spelled correctly and try again"
There seems to be name confusion here. "samashare" is a leftover from an earlier attempt - even though that I have uninstalled correctly Samba. The same goes for "workgroup = SAMBATF".
I dont see 'netbios name' anywhere.
I dont really understand what is going on here, but I have only 1 user (torben) and I have input a passwd for him (me). I think I need to have an overview of Samba in order to understand.
best regards
torben
Hi TheFu,<br>Thank you for your answer. It has apparently advanced me:<br><br>Torben@torben-Aspire-E5-773G:/etc/samba$ testparm<br>Load smb config files from /etc/samba/smb.conf<br>Loaded services file OK.<br>Weak crypto is allowed<br>WARNING: The 'netbios name' is too long (max. 15 chars).<br><br>Server role: ROLE_STANDALONE<br><br>Press enter to see a dump of your service definitions<br><br># Global parameters<br>[global]<br> bind interfaces only = Yes<br> log file = /var/log/samba/log.%m<br> logging = file<br> map to guest = Bad User<br> max log size = 1000<br> obey pam restrictions = Yes<br> pam password change = Yes<br> panic action = /usr/share/samba/panic-action %d<br> passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .<br> passwd program = /usr/bin/passwd %u<br> server role = standalone server<br> server string = %h server (Samba, Ubuntu)<br> unix password sync = Yes<br> usershare allow guests = Yes<br> workgroup = SAMBATF<br> idmap config * : backend = tdb<br><br><br>[printers]<br> browseable = No<br> comment = All Printers<br> create mask = 0700<br> path = /var/spool/samba<br> printable = Yes<br><br><br>[print$]<br> comment = Printer Drivers<br> path = /var/lib/samba/printers<br><br><br>[homes]<br> comment = Home Directories<br> create mask = 0644<br> read only = No<br> valid users = %S<br> wide links = Yes<br>torben@torben-Aspire-E5-773G:/etc/samba$ <br><br>Here is the answer I get from Windows:<br><br>"You cant get access to \\192.168.110.19\sambashare"<br><br>and when I press diagnostics I get:<br><br>"check that sambashare is spelled correctly and try again"<br><br>There seems to be name confusion here. "samashare" is a leftover from an earlier attempt - even though that I have uninstalled correctly Samba. The same goes for "workgroup = SAMBATF". <br>I dont see 'netbios name' anywhere.<br><br>I dont really understand what is going on here, but I have only 1 user (torben) and I have input a passwd for him (me). I think I need to have an overview of Samba in order to understand.<br>best regards<br>torben<br><br>
Hi Morbius1,
As I told TheFu I need a description of Samba even to undestand your questions, but:
Yes, that is what I did.
and:
I want to access the files I have on a Windows machine on the same router (192.168.119.1) from my Linux machine which is the one I am using now.
best regards
torben
Morbius1
February 6th, 2022, 01:00 PM
[1] Please verify the ip address of your Ubuntu box by running this command:
hostname -I
[2] Turn off your Ubuntu firewall if you enabled it:
sudo ufw disable
[3] Can you ping that Ubuntu ip address from Windows - Open Command Prompt and run:
ping 192.168.110.???
Using the ip address you found in step [1]
[4] Just in case you have done so do you get any output from this command:
net usershare info --long
If there is no output that is OK.
[5] Did you add torben to the samba password database:
sudo smbpasswd -a torben
[6] Please tell us which version of Windows you are using.
With ufw disabled and a possible change to the ip address try to access it again with one of these:
\\192.168.110.???
\\192.168.110.???\homes
\\192.168.110.???\torben
TheFu
February 6th, 2022, 02:44 PM
\\192.168.110.19\sambashare should probably be
\\192.168.110.19\torben now.
It needs to be the UNIX username. The username you log into the Linux box using. The [homes] section provides access to the HOME directories for usernames , if they have a smbpasswd added.
This all assumes the IP is correct. If the IP address is wrong, nothing will happen. It will try to connect to the wrong system.
foxsquirrel
February 6th, 2022, 03:16 PM
Samba on windows will connect using hostname and share folder
just type \\hostname\yoursambasharename
If its visible to the win box it will autofill.
Hope you did not follow old information and activate smb1.0 on your winbox that is not a good thing to do.
Just so you are not chasing your tail, first try to ssh into the server from your win10 box.
from a cmd prompt
c:\xx\yy>ssh username@hostname
If that works its an issue configuring your sambashare. Take one step at a time.
torbentf
February 6th, 2022, 03:34 PM
Hi Morbius1,
I can ping 192.168.110.19
torben@torben-Aspire-E5-773G:~$ net usershare info --long
torben@torben-Aspire-E5-773G:~$
No output
torben@torben-Aspire-E5-773G:~$ sudo smbpasswd -a torben
New SMB password:
Retype new SMB password:
torben@torben-Aspire-E5-773G:~$
Windows 8.1
\\192.168.110.19 I get a list of network addresses
\\192.168.110.19\homes I get a list of files in my home directory
\\192.168.110.19\torben I get a list of files in my home directory
best regards
torben
Hi Morbius1,
I can ping 192.168.110.19
torben@torben-Aspire-E5-773G:~$ net usershare info --long
torben@torben-Aspire-E5-773G:~$
No output
torben@torben-Aspire-E5-773G:~$ sudo smbpasswd -a torben
New SMB password:
Retype new SMB password:
torben@torben-Aspire-E5-773G:~$
Windows 8.1
\\192.168.110.19 I get a list of network addresses
\\192.168.110.19\homes I get a list of files in my home directory
\\192.168.110.19\torben I get a list of files in my home directory
best regards
torben
Hi TheFu,
\\192.168.110.19\homes I get a list of files in my home directory
\\192.168.110.19\torben I get a list of files in my home directory
best regards
torben
Hi Foxsquirrel,
torben@torben-Aspire-E5-773G:~$ ssh torben@192.168.110.19
The authenticity of host '192.168.110.19 (192.168.110.19)' can't be established.
ECDSA key fingerprint is SHA256:qATadk9NGsiAN6x/9iFwVr1OfjZbJFqCirtZ2n2KS58.
Are you sure you want to continue connecting (yes/no/[fingerprint])? y
Please type 'yes', 'no' or the fingerprint: yes
Warning: Permanently added '192.168.110.19' (ECDSA) to the list of known hosts.
torben@192.168.110.19's password:
Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.11.0-44-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
15 updates can be applied immediately.
To see these additional updates run: apt list --upgradable
Your Hardware Enablement Stack (HWE) is supported until April 2025.
*** System restart required ***
Last login: Sat Jun 5 12:23:42 2021 from 192.168.110.12
torben@torben-Aspire-E5-773G:~$
That qualifies as "it works" ?
best regards
torben
Hi everybody,
I seem to have lost some of the answers I thought I had sent. I will try to reconstruct.
Answer to TheFu:
\\192.168.110.19\homes I get a list of files in my home directory
\\192.168.110.19\torben I get a list of files in my home dire
Answer to oxsquirrel:
The first time I used "ssh" I got a comprehensive answer that indicated that it was not a sambashare issue. No I get the answer that "ssh" is not recognized.....
torben
TheFu
February 6th, 2022, 05:45 PM
So ... everything is working. IF so, please mark the thread as SOLVED, using the thread tools button near the top of the page.
It would be very helpful is everything typed and output in a terminal were wrapped in 'code-tags' when posting to these forums.
Https://ubuntuforums.org/misc.php?do=bbcode#code a how-to.
foxsquirrel
February 6th, 2022, 05:59 PM
It looks like you do have a valid connection to the server using ssh.
Your big issue is windows 8.1. Pretty sure that only supports smb1.0 and don't recall it having ssh installed, but you have connected.
If you must share with 8.1, not sure if I am correct on this, server and client might have to be set to run smb1.0, that is not good if you are connected to the internet.
torbentf
February 7th, 2022, 10:01 AM
Hi
Can you help me with the overall picture?
- I have installed the server on my Linux machine? That means I can access my Linux files from the Windows machine? Can I also access my Windows files from my Linux machine?
- I have 2 users which both access my home-files from the windows machine: one comes from the addition of [homes] in the conf file, the other from my making a user (torben) with a password? What is the difference between them?
- on my Linux machine I have a lot of files from my many attempts at installing Samba. Are they needed?
best regards
torben
Morbius1
February 7th, 2022, 02:06 PM
- I have installed the server on my Linux machine? That means I can access my Linux files from the Windows machine? Can I also access my Windows files from my Linux machine?
Yes, you just need to do so with a slightly different syntax.
Open Files ( Nautilus ) > Other Locations > Connect to Server and enter it's network path:
smb://windows-ip-address/windows-share-name
Like this example:
289983
Note: Ubuntu already comes with client side SMB access capability. One is in the Linux Kernel itself with mount.cifs and the other are samba client libraries installed beacuse of Nautilus.
I have 2 users which both access my home-files from the windows machine: one comes from the addition of [homes] in the conf file, the other from my making a user (torben) with a password? What is the difference between them?
Are you talking about the smbpasswd command?
Share definitions ( like [homes] ) determines what can be shared on the server. In Windows a given user name and password is used both locally to log into the physical machine itself and also across the local network.
In Samba there are two: THe local Linux user name and password used to log into the physical Linux machine and another to access the samba share. The smbpasswd command tells samba that the local Linux user name should be added to the samba password database.
Note: File this under .. My Opinion.
I've yet to find a use case for the traditional [homes] share in a typical home network. It allows userA on MachineA to access his home directory on the Linux machine. The presumption is that UserA has a home directory on the Linux box to access. If the intent is to share Folders on the Linux machine with many users on the network how does this help. Do you want userB on machineB to have access to your home directory - by using your user name and password?
Creating a share of a folder in your home directory better fits the situation where all of the machines on your local network are peers to each other. But again I do not know how you are using this samba share. If a [homes] share works for you ignore my opinion
- on my Linux machine I have a lot of files from my many attempts at installing Samba. Are they needed?
That I cannot answer since I don't know what these files contain or why they were created.
torbentf
February 8th, 2022, 11:37 AM
Hi Morbius1,
smb://windows-ip-address/windows-share-name:
-I have "windows-ip-address", but is "windows-share-name" something I make and how? I can't find it in the data I have "filled in" when setting up Samba.
Files:
I will rename them one by one and see if it has an effect
Setting up the system:
I have been through a lot, but I found this:
https://computingforgeeks.com/install-and-configure-samba-server-share-on-ubuntu/
I followed it (the instructions are easy to follow) until I came to (near the end):
cat /.sambacreds
when I got the message: No permission.
I tried (i think) every way to set up /.sambacreds and at the same time give it the right permissions, but to no avail.
What can I do?
I have sent an email to "computingforgeegs"/Josphat Mutai, but maybe you can help
torben
Morbius1
February 8th, 2022, 01:19 PM
smb://windows-ip-address/windows-share-name:
-I have "windows-ip-address", but is "windows-share-name" something I make and how? I can't find it in the data I have "filled in" when setting up Samba.
It is the name of the share you created on your Windows box.
Go to your Windows box, open Command Prompt, and run the following command:
net share
Ignore any "Share name" that ends in a $ and the Users share name. If you don't have any left you haven't created any share so there is nothing for the Linux client to access.
torbentf
February 8th, 2022, 08:45 PM
Hi Morbius1,
Thank you!
torben
torbentf
February 9th, 2022, 07:52 PM
Hi Morbius1,
I am sorry, but I am lost.
There was no shared drives left as a result of "net share". So I have to create one on Windows? Is there a simple way to do that?
torben
Morbius1
February 10th, 2022, 11:38 PM
This one looks more or less correct: How to Create A Shared Folder on Windows 8/8.1 (http://https://www.isunshare.com/windows-8/create-a-shared-folder-on-windows-8-8.1.html)
I would start this in a more conventional way by creating a folder off the C drive rather than in one's user directory and sharing that. Something like C:\Shared for example
Powered by vBulletin® Version 4.2.2 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.