Samba Problem

Hi

I am new to Samba, somehow so far I managed to create a public share. Now I need to create another share but this time it requires a username and password.

I can’t understand the process of creating such a share. I am trying to create a samba user account using smbpasswd -a but it does not want to work. The following is copied from the terminal window.

linux-8cgh:/home/administrator # smbpasswd -a test
New SMB password:
Retype new SMB password:
Failed to add entry for user test.
You have mail in /var/mail/root

I appreciate any help as I’m feeling like a hopeless case :’(:shame:

Thanks!!

Do you have a user called test setup on the machine?

Hi, Thanks for your prompt reply. I have to create a system user account and use it for the samba user account? I’m going to try it now.

Thanks.

To be honest it is a guess. I never have tried it.

here is a good starter on Samba

Samba and Suse: HowTo Set up an openSUSE-Windows Home Office LAN/Network. Versions 11.x

The user account works. Is it possible to create this password protected share using the tool available in Yast or it works better when configured by editing the configuration file?

Well personally and only working with small home P2P I have found edit the config file manually much easier the GUI tends to put extraneous stuff in. I always fallow the instruction on the site I referenced above. It makes the concepts much easier to understand. Take 1/2 hour and read it you will not regret it.

A Samba user account must also be a Linux user account first. Not a system user account, just a normal user account will do.

Hi thanks for the link I really found it useful! However I still have one problem I wish to solve. I created the share and when I try to connect to the share I’m being asked to authenticate myself (so far so good). However when I enter the account details it does not connect.

The following are my main two shares

[managment]
path = /home/administrator/Documents/file_structure/management
read only = no
access = kaiser
force user = kaiser

[ordnerstruktur]
path = /home/administrator/Documents/file_structure/ordnerstruktur
read only = no
guest ok = yes
force user = administrator

I have 2 shares: ordnerstruktur works (public), however management does not work. Both are situated on the adminsitrator account as you can see from the path. I want the user kaiser to be the only one able to access managament. Any help would be appreciated. I will continue checking that link and try some other things maybe I manage to solve this. Thanks again :smiley:

Regarding this share:

[managment]
path = /home/administrator/Documents/file_structure/management
read only = no
access = kaiser
force user = kaiser

There are several ways to do this such that only kaiser can access the share, I’ll show one, here are the steps:

  1. change the ownership of the directory “management” and its contents over to kaiser with this command:
sudo chown -R kaiser:users /home/administrator/Documents/file_structure/management
  1. change this line
access = kaiser

to this

valid users = kaiser
  1. add kaiser to the samba user database with this command
sudo smbpasswd -a kaiser

There is an article on structuring shares for various purposes. Might be useful:
Samba Server and Suse / openSUSE: HowTo Configure a Professional File Server on a SOHO LAN

Hi swerdna! Thanks for your tips :slight_smile: I have followed your steps however I think that the ownership has not changed to kaiser as when I go on the folder with dolphin and check the permissions under owner. administrator is being listed.

When I try connecting to the share using win7 it displays an authentication box and a few seconds after I enter the details the following message appears>

“The network folder specified is currently mapped using a different user name and password. To connect using a different user name and password, first disconnect any existing mappings to this network drive”

Check the syntax, it’s “sudo chown -R kaiser:users /path_to_the_folder”

If you made a mapped drive in win7, unmake it.
Otherwise, reboot windows.

You log on from windows as kaiser

Get the chown thing and the permissions on the shared folder in openSUSE right first

Fixed the chown issue I had a typo managment instead of management xD

With regards to the win7 problem, can there be more than one mapped network drive? I wish to have both ornderstruktur and management as mapped drives…

I will try accessing the share from a different pc with no mapped drives

It works when I remove all maps. I can also run ordnerstruktur beside management.

It doesn’t work when ordnerstruktur is on. Can this be fixed? Or is its a compatability issue with Windows. On Ubuntu it works perfectly!

Thanks for your help!

Is Ubuntu still available? If “yes” then post here the contents of the file smb.conf from Ububtu so we can examine the difference **