[Closed] Setting up Samba

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[Closed] Setting up Samba

Postby turboscrew » Sep 30th, '14, 10:10

How does one set up Samba on Mageia?
Smbtree doesn't show anything even if testparm doesn't give any errors.
Also, how does one restart smbd and nmbd on Mageia? "service smbd restart" doesn't work.

And is there a "current" way to make all shares available to anyone able to access my LAN without
logging in now that "security=share" is deprecated?
I recall there was something else "deprecated" in newer samba (4.1.6) too.

This is 4th OS (and 3th motherboard) sharing the same partitions, so I'm not thrilled about changing the rights/ownership of the stuff in
the shared partitions. (That is, the partition has already outlasted three motherboards, and probably continues to outlast HW.)
The partitions to share are mounted via fstab to make sure the shares are there even if nobody is logged in.
I'd also like to share my printer.

Should I put my smb.conf here? It's quite big. Maybe I should remove some excess stuff?
(On my older systems the smb.conf was only maybe 2 pages.)

EDIT:
This is wat testparm says:
Code: Select all
[jaa@localhost ~]$ testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Processing section "[print$]"
Processing section "[pdf-gen]"
Processing section "[NewVolume]"
WARNING: The security=share option is deprecated
Loaded services file OK.
Warning: Service printers defines a print command, but rameter is ignored when using CUPS libraries.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
        netbios name = JAA-MAGEIA
        server string = %h
        security = SHARE
        map to guest = Bad User
        log file = /var/log/samba/%m.log
        max log size = 50
        printcap cache time = 60
        printcap name = cups
        dns proxy = No
        idmap config * : backend = tdb

[homes]
        comment = Home Directories
        read only = No
        browseable = No

[printers]
        comment = All Printers
        path = /var/spool/samba
        create mask = 0700
        guest ok = Yes
        printable = Yes
        print ok = Yes
        print command = lpr-cups -P %p -o raw %s -r # using client side printer drivers.
        use client driver = Yes
        browseable = No

[print$]
        path = /var/lib/samba/printers
        write list = @adm, root
        inherit permissions = Yes
        guest ok = Yes

[pdf-gen]
        comment = PDF Generator (only valid users)
        path = /var/tmp
        printable = Yes
        print ok = Yes
        printing = bsd
        print command = /usr/share/samba/scripts/print-pdf "%s" "%H" "//%L/%u" "%m" "%I" "%J" &
        lpq command = /bin/true
        lprm command = lprm -P'%p' %j

[NewVolume]
        comment = NewVolume
        path = /mnt/newvolume
        read only = No
        guest ok = Yes
[jaa@localhost ~]$


I also wondered about the two instances of smbd:

Code: Select all
[jaa@localhost ~]$ !ps
ps axu | grep nmbd
root     29404  0.0  0.0  58976  2016 ?        Ss   11:48   0:00 nmbd -D
jaa      29588  0.0  0.0 105176   956 pts/1    S+   11:52   0:00 grep --color nmbd
[jaa@localhost ~]$ ps axu | grep smbd[jaa@localhost ~]$ ps axu | grep smbd
root     29394  0.0  0.1 107460  4076 ?        Ss   11:48   0:00 smbd -D
root     29399  0.0  0.0 107976  2572 ?        S    11:48   0:00 smbd -D
jaa      29598  0.0  0.0 105176   960 pts/1    S+   11:53   0:00 grep --color smbd


BTW, what's the preferred way in Mageia concerning Samba and printers?
Hand-editing or configuration tools?
In some distro-communities it seems to be configuration tools whereas in some other
the people refuse to take a look into tool-generated (big) configuration files.
Last edited by turboscrew on Oct 6th, '14, 23:26, edited 1 time in total.
Mageia 4.1 on GA-B75M-D3H / Intel i3-3220 CPU @ 3.30GHz RAM: 4GB
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland

Re: Setting up Samba

Postby jkerr82508 » Sep 30th, '14, 11:55

turboscrew wrote:How does one set up Samba on Mageia?
http://doc.mageia.org/mcc/4/en/content/draksambashare.html
how does one restart smbd
Code: Select all
systemctl restart smb
Likewise start, stop, status. See 'man systemctl' for details.

Jim
jkerr82508
 
Posts: 946
Joined: Mar 26th, '11, 01:34
Location: Fife, Scotland

Re: Setting up Samba

Postby turboscrew » Sep 30th, '14, 13:22

Thanks, Jim.
Mageia 4.1 on GA-B75M-D3H / Intel i3-3220 CPU @ 3.30GHz RAM: 4GB
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland

Re: Setting up Samba

Postby xboxboy » Sep 30th, '14, 16:21

When I'm messing with samba I install the drakwizard package, which then provides a GUI inside MCC for setting it up.
Same with printers, I always use MCC. It's quick and easy, and rarely fails. If you were doing it all day, everyday, I guess config files would be faster, but when you only mess with these things once or twice a year (like me), a few mouse clicks is easier to remember.

It's really upto you though. There are no hard and fast rules.
xboxboy
 
Posts: 401
Joined: Jun 2nd, '13, 06:41

Re: Setting up Samba

Postby jkerr82508 » Sep 30th, '14, 17:10

xboxboy wrote:When I'm messing with samba I install the drakwizard package

You don't actually need drakwizard for samba configuration, which is available within the default MCC. I suppose that the theory is that "ordinary" users might use samba, but would probably not use a web server, ftp server etc. for which drakwizard provides GUI configuration tools.

Jim
jkerr82508
 
Posts: 946
Joined: Mar 26th, '11, 01:34
Location: Fife, Scotland

Re: Setting up Samba

Postby turboscrew » Sep 30th, '14, 22:01

I tried using MCC (share drives and directories with Windows (SMB) systems).
Samba Server - menu / Configure
-> stand-alone
-> workgroup: WORKGROUP
-> NetBIOS name: JAA-MAGEIA
-> security mode: share
-> Hosts allow: 192.168.1.
-> banner: %h
-> logfile: (the defaults)
Samba Server - menu / Restart

testparm accepted everything.
After about 5 minutes:

Code: Select all
[jaa@localhost ~]$ sudo smbtree
WARNING: The security=share option is deprecated
Enter root's password:
[jaa@localhost ~]$


Oh, and file share
Code: Select all
Directory: /mnt/newvolume
Public: yes
Writeable: yes
Browseable: yes


I tried to check the printer shares:
printers: all / mofify
but got an error message about draksambashare line 350.

(It would be nice if the DE allowed copying the text in the pop-ups into clipboard.)

BTW:
Code: Select all
[jaa@localhost ~]$ sudo draksambashare
No protocol specified
Cannot be run in console mode.
Last edited by doktor5000 on Oct 1st, '14, 02:18, edited 1 time in total.
Reason: added code tags
Mageia 4.1 on GA-B75M-D3H / Intel i3-3220 CPU @ 3.30GHz RAM: 4GB
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland

Re: Setting up Samba

Postby doktor5000 » Oct 1st, '14, 02:19

turboscrew wrote:BTW:
Code: Select all
[jaa@localhost ~]$ sudo draksambashare
No protocol specified
Cannot be run in console mode.

You need to use sudo -E for that, otherwise important env. variables (like DISPLAY) are stripped away.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18052
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Setting up Samba

Postby turboscrew » Oct 1st, '14, 09:50

Thanks, doktor5000.

During the night something has happened:

[jaa@localhost ~]$ sudo smbtree
WARNING: The security=share option is deprecated
Enter root's password:
Code: Select all
WORKGROUP
        \\KOOLAP         
                \\KOOLAP\tmp           
                \\KOOLAP\stuff         
                \\KOOLAP\Public         
                \\KOOLAP\print$                 Tulostinohjaimet
                \\KOOLAP\IPC$                   Etä-IPC
                \\KOOLAP\D$                     Oletusresurssi (jaettu)
                \\KOOLAP\Canon MP140 series Printer (kopio 1)   Canon MP140 series Printer (kopio 1)
               \\KOOLAP\ADMIN$                 Etähallinta
        \\JAA-MAGEIA     
cli_start_connection: failed to connect to JAA-MAGEIA<20> (0.0.0.0). Error NT_STATUS_BAD_NETWORK_NAME


Tried again with sudo -E draksambashare.
Now after samba server / configure is done, and the las "ok" is pressed, the samba wizard window doesn't close.
When I closed it manually, the whole draksambashare closed.
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland

Re: Setting up Samba

Postby doktor5000 » Oct 1st, '14, 14:13

Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18052
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Setting up Samba

Postby turboscrew » Oct 2nd, '14, 06:55

This I encountered when I run draksambashare from MCC (tried to modify shared printers): Bug 13206

Then there seems to be another 'issue'. Is this something I should report, or is this my setup?
(The 'dbus' error message.)
https://www.dropbox.com/s/mdxoa6wkupp7r8q/draksambashare.png?dl=0
I hope the link is usable. I seem to have some issues with dropbox.
Any suggestions about a better place to store screenshots?
Mageia 4.1 on GA-B75M-D3H / Intel i3-3220 CPU @ 3.30GHz RAM: 4GB
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland

Re: Setting up Samba

Postby doktor5000 » Oct 2nd, '14, 08:13

Below the forum editor (only available in Full editor, not via quick reply), switch to the tab "Upload attachment".
Upload your picture, then when finished, click in the editor window where you want your picture to display,
and click the button "Place inline".

But for such long text output better copy&paste it using code tags as explained in ftp://ftp5.gwdg.de/pub/linux/mandriva/m ... e_tags.ogv
Screenshots are not that good for this, as they also don't allow e.g. to search for some of the error messages via google or whatever search engine possible supporters use.

turboscrew wrote:Then there seems to be another 'issue'. Is this something I should report, or is this my setup?
(The 'dbus' error message.)

I only see an error message about IBUS, not dbus. ( IBUS = http://en.wikipedia.org/wiki/Intelligent_Input_Bus )
Seems pretty irrelevant in this context.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18052
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Setting up Samba

Postby turboscrew » Oct 2nd, '14, 08:46

Oops, sorry. Sloppy reading. IBUS it is.
Ayway, my point was only show the messages on the terminal - almost all messages were there. I guess the first message was not, but
it was about Gtk (I recall).
That is, of course, in addition to the empty window (that used to contain the wizard stuff).
After clicking 'finish' all the contents were cleared and the empty window was left.
So I should report about the empty window left?


By the way, it looks like mu Samba got broken. 'sudo smbtree' and 'sudo systemctl restart smb' both hang.
The same thing after 2 reboots.

The testparm doesn't complain about anything (except "security=share"), smbd-logs doesn't have anything but startup-announcements.
Nmbd logs do have complaints:
Code: Select all
[2014/09/30 23:23:53,  0] nmbd/nmbd_incomingrequests.c:172(process_name_refresh_request)
  process_name_refresh_request: unicast name registration request received for name KOOLAP<20> from IP 192.168.1.58 on subnet UNICAST_SUBNET.
[2014/09/30 23:23:53,  0] nmbd/nmbd_incomingrequests.c:173(process_name_refresh_request)
  Error - should be sent to WINS server
...
[2014/10/01 03:55:53,  0] nmbd/nmbd_incomingrequests.c:172(process_name_refresh_request)
  process_name_refresh_request: unicast name registration request received for name KOOLAP<00> from IP 192.168.1.58 on subnet UNICAST_SUBNET.
[2014/10/01 03:55:53,  0] nmbd/nmbd_incomingrequests.c:173(process_name_refresh_request)
  Error - should be sent to WINS server
[2014/10/01 04:02:01,  0] nmbd/nmbd.c:128(nmbd_sig_hup_handler)
  Got SIGHUP dumping debug info.
[2014/10/01 04:02:01,  0] nmbd/nmbd_workgroupdb.c:276(dump_workgroups)
  dump_workgroups()
   dump workgroup on subnet    192.168.1.33: netmask=  255.255.255.0:
        WORKGROUP(1) current master browser = JAA-MAGEIA
                JAA-MAGEIA 40849a03 (localhost)
Mageia 4.1 on GA-B75M-D3H / Intel i3-3220 CPU @ 3.30GHz RAM: 4GB
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland

Re: Setting up Samba

Postby doktor5000 » Oct 2nd, '14, 15:06

Please show the output as root of
Code: Select all
systemctl status smb
smbclient -L \\localhost
grep -v -e ^# -e ^$ /etc/samba/smb.conf
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18052
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Setting up Samba

Postby turboscrew » Oct 2nd, '14, 22:05

Code: Select all
[root@localhost samba]# systemctl status smb
smb.service - LSB: Samba servers (nmbd and smbd)
   Loaded: loaded (/etc/rc.d/init.d/smb)
   Active: failed (Result: timeout) since Thu 2014-10-02 09:26:43 EEST; 13h ago
  Process: 1360 ExecStart=/etc/rc.d/init.d/smb start (code=killed, signal=TERM)
   CGroup: /system.slice/smb.service
           |-1380 /bin/bash -c ulimit -S -c 0 >/dev/null 2>&1 ; smbd -D
           `-1382 smbd -D

Oct 02 09:21:43 localhost systemd[1]: Starting LSB: Samba servers (nmbd and smbd)...
Oct 02 09:26:43 localhost systemd[1]: smb.service operation timed out. Terminating.
Oct 02 09:26:43 localhost systemd[1]: Failed to start LSB: Samba servers (nmbd and smbd).
Oct 02 09:26:43 localhost systemd[1]: Unit smb.service entered failed state.
[root@localhost samba]# smbclient -L \\localhost
WARNING: The security=share option is deprecated
^C
[root@localhost samba]# grep -v -e ^# -e ^$ /etc/samba/smb.conf
[global]
   workgroup = WORKGROUP
   server string = %h server
   wins support = yes
;   wins server = w.x.y.z
   dns proxy = no
   name resolve order = lmhosts wins bcast host
;   interfaces = 127.0.0.0/8 eth0
   interfaces = lo eth0
   bind interfaces only = yes
   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 0
   security = share
   encrypt passwords = true
   passdb backend = tdbsam
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
   pam password change = yes
   map to guest = bad user
   guest account = jaa
   force user = jaa
;   domain logons = yes
;   logon path = \\%N\profiles\%U
;   logon drive = H:
;   logon script = logon.cmd
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u
; add machine script  = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u
; add group script = /usr/sbin/addgroup --force-badname %g
   load printers = yes
;   printing = bsd
;   printcap name = /etc/printcap
   printing = cups
   printcap name = cups
;   include = /home/samba/etc/smb.conf.%m
   socket options = TCP_NODELAY
;   message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &
;   idmap uid = 10000-20000
;   idmap gid = 10000-20000
;   template shell = /bin/bash
;   winbind enum groups = yes
;   winbind enum users = yes
;   usershare max shares = 100
[homes]
   comment = Home Directories
   browseable = no
   read only = yes
   create mask = 0777
   directory mask = 0777
   valid users = %S
;[netlogon]
;   comment = Network Logon Service
;   path = /home/samba/netlogon
;   guest ok = yes
;   read only = yes
;[profiles]
;   comment = Users profiles
;   path = /home/samba/profiles
;   guest ok = yes
;   browseable = yes
;   create mask = 0600
;   directory mask = 0700
[Guest Share]
   path = /mnt/newvolume
   browseable = yes
   read only = no
   guest ok = yes
[printers]
   comment = All Printers
   path = /var/spool/samba
   printable = yes
   guest ok = yes
   browseable = yes
   read only = no
   create mask = 0777
   use client driver = yes
   public = yes
[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = yes
   write list = root, @lpadmin
;[cdrom]
;   comment = Samba server's CD-ROM
;   read only = yes
;   locking = no
;   path = /cdrom
;   guest ok = yes
;   preexec = /bin/mount /cdrom
;   postexec = /bin/umount /cdrom


The ctrl-C is there because the command hung.

This is a smb.conf that used to work in Mint 16.
The hanging took place before exchanging the smb.conf files.
Maybe I'll put the draksambashare-generated smb.conf back and do the same with it...
Mageia 4.1 on GA-B75M-D3H / Intel i3-3220 CPU @ 3.30GHz RAM: 4GB
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland

Re: Setting up Samba

Postby turboscrew » Oct 2nd, '14, 22:29

Funny, it let me restart. (This posting is with the generated smb.conf - not the smb.conf from my older Mint 16)

Code: Select all
[root@localhost samba]# systemctl status smb
smb.service - LSB: Samba servers (nmbd and smbd)
   Loaded: loaded (/etc/rc.d/init.d/smb)
   Active: active (running) since Thu 2014-10-02 23:25:37 EEST; 27s ago
  Process: 29016 ExecStart=/etc/rc.d/init.d/smb start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/smb.service
           |- 1380 /bin/bash -c ulimit -S -c 0 >/dev/null 2>&1 ; smbd -D
           |- 1382 smbd -D
           |-29023 smbd -D
           |-29031 nmbd -D
           `-29039 smbd -D

Oct 02 23:25:37 localhost systemd[1]: Starting LSB: Samba servers (nmbd and smbd)...
Oct 02 23:25:37 localhost smb[29016]: Starting SMB services: [  OK  ]
Oct 02 23:25:37 localhost smb[29016]: Starting NMB services: [  OK  ]
Oct 02 23:25:37 localhost systemd[1]: Started LSB: Samba servers (nmbd and smbd).
[root@localhost samba]# smbclient -L \\localhost
WARNING: The security=share option is deprecated
Enter root's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.24]
Server requested LANMAN password (share-level security) but 'client lanman auth = no' or 'client ntlmv2 auth = yes'
tree connect failed: NT_STATUS_ACCESS_DENIED

Code: Select all
[root@localhost samba]# grep -v -e ^# -e ^$ /etc/samba/smb.conf
[global]
   
    # 1. Server Naming Options:
    # workgroup = NT-Domain-Name or Workgroup-Name
    workgroup = WORKGROUP
   
    # netbios name is the name you will see in "Network Neighbourhood",
    # but defaults to your hostname
    #  netbios name = <name_of_this_server>
   
    # server string is the equivalent of the NT Description field
    server string = %h
   
    # Message command is run by samba when a "popup" message is sent to it.
    # The example below is for use with LinPopUp:
    ; message command = /usr/bin/linpopup "%f" "%m" %s; rm %s
   
    # 2. Printing Options:
    # Required to load all CUPS printers
    printcap name = cups
    load printers = yes
   
    # printcap cache time, so samba will automatically load new cups printers
    printcap cache time = 60
   
    # It should not be necessary to spell out the print system type unless
    # yours is non-standard. Currently supported print systems include:
    # bsd, sysv, plp, lprng, aix, hpux, qnx, cups
    printing = cups
   
    # Samba 2.2 supports the Windows NT-style point-and-print feature. To
    # use this, you need to be able to upload print drivers to the samba
    # server. The printer admins (or root) may install drivers onto samba.
    # Note that this feature uses the print$ share, so you will need to
    # enable it below.
    # Printer admins are now defined by granting the SePrintOperatorPrivilege, ie:
    # run: net rpc rights grant 'DOMAIN\Printer Operators' SePrintOperatorPrivilege
   
    # 3. Logging Options:
    # this tells Samba to use a separate log file for each machine
    # that connects
    log file = /var/log/samba/%m.log
   
    # Put a capping on the size of the log files (in Kb).
    max log size = 50
   
    # Set the log (verbosity) level (0 <= log level <= 10)
    # log level = 3
   
    # 4. Security and Domain Membership Options:
    # This option is important for security. It allows you to restrict
    # connections to machines which are on your local network. The
    # following example restricts access to two C class networks and
    # the "loopback" interface. For more examples of the syntax see
    # the smb.conf man page. Do not enable this if (tcp/ip) name resolution does
    # not work for all the hosts in your network.
    #   hosts allow = 192.168.1. 192.168.2. 127.
   
    # Uncomment this if you want a guest account, you must add this to /etc/passwd
    # otherwise the user "nobody" is used
    #  guest account = pcguest
    # Allow users to map to guest:
    map to guest = bad user
   
    # Security mode. Most people will want user level security. See
    # security_level.txt for details.
    security = share
    # Use password server option only with security = server or security = domain
    # When using security = domain, you should use password server = *
    #   password server = <NT-Server-Name>
    #   password server = *
   
    # Password Level allows matching of _n_ characters of the password for
    # all combinations of upper and lower case.
    #  password level = 8
    #  username level = 8
   
    # You may wish to use password encryption. Please read
    # ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
    # Do not enable this option unless you have read those documents
    # Encrypted passwords are required for any use of samba in a Windows NT domain
    # The smbpasswd file is only required by a server doing authentication, thus
    # members of a domain do not need one.
    encrypt passwords = yes
    smb passwd file = /etc/samba/smbpasswd
   
    # The following are needed to allow password changing from Windows to
    # also update the Linux system password.
    # NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.
    # NOTE2: You do NOT need these to allow workstations to change only
    #        the encrypted SMB passwords. They allow the Unix password
    #        to be kept in sync with the SMB password.
    ;  unix password sync = Yes
    # You either need to setup a passwd program and passwd chat, or
    # enable pam password change
    ;  pam password change = yes
    #  passwd program = /usr/bin/passwd '%u'
    ;  passwd chat = *New*UNIX*password* %n\n *Re*ype*new*UNIX*password* %n\n \
    ;*passwd:*all*authentication*tokens*updated*successfully*
   
    # Unix users can map to different SMB User names
    ;  username map = /etc/samba/smbusers
   
    # Using the following line enables you to customise your configuration
    # on a per machine basis. The %m gets replaced with the netbios name
    # of the machine that is connecting
    #   include = /etc/samba/smb.conf.%m
   
    # Options for using winbind. Winbind allows you to do all account and
    # authentication from a Windows or samba domain controller, creating
    # accounts on the fly, and maintaining a mapping of Windows RIDs to unix uid's
    # and gid's. winbind uid and winbind gid are the only required parameters.
    #
    # winbind uid is the range of uid's winbind can use when mapping RIDs to uid's
    #  idmap uid = 10000-20000
    #
    # winbind gid is the range of uid's winbind can use when mapping RIDs to gid's
    #  idmap gid = 10000-20000
    #
    # winbind separator is the character a user must use between their domain
    # name and username, defaults to "\"
    #  winbind separator = +
    #
    # winbind use default domain allows you to have winbind return usernames
    # in the form user instead of DOMAIN+user for the domain listed in the
    # workgroup parameter.
    #  winbind use default domain = yes
    #
    # template homedir determines the home directory for winbind users, with
    # %D expanding to their domain name and %U expanding to their username:
    #  template homedir = /home/%D/%U
   
    # When using winbind, you may want to have samba create home directories
    # on the fly for authenticated users. Ensure that /etc/pam.d/samba is
    # using 'service=system-auth-winbind' in pam_stack modules, and then
    # enable obedience of pam restrictions below:
    #  obey pam restrictions = yes
   
    #
    # template shell determines the shell users authenticated by winbind get
    #  template shell = /bin/bash
   
    # 5. Browser Control and Networking Options:
    # Configure Samba to use multiple interfaces
    # If you have multiple network interfaces then you must list them
    # here. See the man page for details.
    #   interfaces = 192.168.12.2/24 192.168.13.2/24
   
    # Configure remote browse list synchronisation here
    #  request announcement to, or browse list sync from:
    #       a specific host or from / to a whole subnet (see below)
    #   remote browse sync = 192.168.3.25 192.168.5.255
    # Cause this host to announce itself to local subnets here
    #   remote announce = 192.168.1.255 192.168.2.44
   
    # set local master to no if you don't want Samba to become a master
    # browser on your network. Otherwise the normal election rules apply
    #   local master = no
   
    # OS Level determines the precedence of this server in master browser
    # elections. The default value should be reasonable
    #   os level = 33
   
    # Domain Master specifies Samba to be the Domain Master Browser. This
    # allows Samba to collate browse lists between subnets. Don't use this
    # if you already have a Windows NT domain controller doing this job
    #   domain master = yes
   
    # Preferred Master causes Samba to force a local browser election on startup
    # and gives it a slightly higher chance of winning the election
    #   preferred master = yes
   
    # 6. Domain Control Options:
    # Enable this if you want Samba to be a domain logon server for
    # Windows95 workstations or Primary Domain Controller for WinNT and Win2k
    #   domain logons = yes
   
    # if you enable domain logons then you may want a per-machine or
    # per user logon script
    # run a specific logon batch file per workstation (machine)
    #   logon script = %m.bat
    # run a specific logon batch file per username
    #   logon script = %u.bat
   
    # Where to store roaming profiles for WinNT and Win2k
    #        %L substitutes for this servers netbios name, %u is username
    #        You must uncomment the [Profiles] share below
    #   logon path = \\%L\Profiles\%u
   
    # Where to store roaming profiles for Win9x. Be careful with this as it also
    # impacts where Win2k finds it's /HOME share
    # logon home = \\%L\%u\.profile
   
   
    # The add user script is used by a domain member to add local user accounts
    # that have been authenticated by the domain controller, or when adding
    # users via the Windows NT Tools (ie User Manager for Domains).
   
    # Scripts for file (passwd, smbpasswd) backend:
    # add user script = /usr/sbin/useradd -s /bin/false '%u'
    # delete user script = /usr/sbin/userdel '%s'
    # add user to group script = /usr/bin/gpasswd -a '%u' '%g'
    # delete user from group script = /usr/bin/gpasswd -d '%u' '%g'
    # set primary group script = /usr/sbin/usermod -g '%g' '%u'
    # add group script = /usr/sbin/groupadd %g && getent group '%g'|awk -F: '{print $3}'
    # delete group script = /usr/sbin/groupdel '%g'
   
    # Scripts for LDAP backend (assumes nss_ldap is in use on the domain controller,
    # and needs configuration in smbldap_conf.pm
    # add user script = /usr/sbin/smbldap-useradd -m '%u'
    # delete user script = /usr/sbin/smbldap-userdel '%u'
    # add user to group script = /usr/sbin/smbldap-groupmod -m '%u' '%g'
    # delete user from group script = /usr/sbin/smbldap-groupmod -x '%u' '%g'
    # set primary group script = /usr/sbin/smbldap-usermod -g '%g' '%u'
    # add group script = /usr/sbin/smbldap-groupadd '%g' && /usr/sbin/smbldap-groupshow %g|awk '/^gidNumber:/ {print $2}'
    # delete group script = /usr/sbin/smbldap-groupdel '%g'
   
   
    # The add machine script is use by a samba server configured as a domain
    # controller to add local machine accounts when adding machines to the domain.
    # The script must work from the command line when replacing the macros,
    # or the operation will fail. Check that groups exist if forcing a group.
    # Script for domain controller for adding machines:
    # add machine script = /usr/sbin/useradd -d /dev/null -g machines -c 'Machine Account' -s /bin/false -M '%u'
    # Script for domain controller with LDAP backend for adding machines (please
    # configure in /etc/samba/smbldap_conf.pm first):
    # add machine script = /usr/sbin/smbldap-useradd -w -d /dev/null -c 'Machine Account' -s /bin/false '%u'
   
    # Domain groups:
    # Domain groups are now configured by using the 'net groupmap' tool
   
    # Enable priveleges, ie allowing members of Domain Admins to join machines
    # to the domain
    # enable privileges = yes
   
    # Samba Password Database configuration:
    # Samba now has runtime-configurable password database backends. Multiple
    # passdb backends may be used, but users will only be added to the first one
    # Default:
    # passdb backend = tdbsam
    # TDB backen with fallback to smbpasswd and guest
    # passdb backend = tdbsam smbpasswd guest
    # LDAP with fallback to smbpasswd guest
    # Enable SSL by using an ldaps url, or enable tls with 'ldap ssl' below.
    # passdb backend = ldapsam:ldaps://ldap.mydomain.com smbpasswd guest
    # Use the samba2 LDAP schema:
    # passdb backend = ldapsam_compat:ldaps://ldap.mydomain.com smbpasswd guest
   
    # Idmap settings (set idmap uid and idmap gid above):
    # Idmap backend to use:
    # idmap backend = ldap:ldap://ldap.mydomain.com
   
    # LDAP configuration for Domain Controlling:
    # The account (dn) that samba uses to access the LDAP server
    # This account needs to have write access to the LDAP tree
    # You will need to give samba the password for this dn, by
    # running 'smbpasswd -w mypassword'
    # ldap admin dn = cn=root,dc=mydomain,dc=com
    # ldap ssl = start_tls
    # start_tls should run on 389, but samba defaults incorrectly to 636
    # ldap port = 389
    # ldap suffix = dc=mydomain,dc=com
    # Seperate suffixes are available for machines, users, groups, and idmap, if
    # ldap suffix appears first, it is appended to the specific suffix.
    # Example for a unix-ish directory layout:
    # ldap machine suffix = ou=Hosts
    # ldap user suffix = ou=People
    # ldap group suffix = ou=Group
    # ldap idmap suffix = ou=Idmap
    # Example for AD-ish layout:
    # ldap machine suffix = cn=Computers
    # ldap user suffix = cn=Users
    # ldap group suffix = cn=Groups
    # ldap idmap suffix = cn=Idmap
   
   
    # 7. Name Resolution Options:
    # All NetBIOS names must be resolved to IP Addresses
    # 'Name Resolve Order' allows the named resolution mechanism to be specified
    # the default order is "host lmhosts wins bcast". "host" means use the unix
    # system gethostbyname() function call that will use either /etc/hosts OR
    # DNS or NIS depending on the settings of /etc/host.config, /etc/nsswitch.conf
    # and the /etc/resolv.conf file. "host" therefore is system configuration
    # dependant. This parameter is most often of use to prevent DNS lookups
    # in order to resolve NetBIOS names to IP Addresses. Use with care!
    # The example below excludes use of name resolution for machines that are NOT
    # on the local network segment
    # - OR - are not deliberately to be known via lmhosts or via WINS.
    # name resolve order = wins lmhosts bcast
   
    # Windows Internet Name Serving Support Section:
    # WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
    #   wins support = yes
   
    # WINS Server - Tells the NMBD components of Samba to be a WINS Client
    #       Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
    #   wins server = w.x.y.z
   
    # WINS Proxy - Tells Samba to answer name resolution queries on
    # behalf of a non WINS capable client, for this to work there must be
    # at least one  WINS Server on the network. The default is NO.
    #   wins proxy = yes
   
    # DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
    # via DNS nslookups. The built-in default for versions 1.9.17 is yes,
    # this has been changed in version 1.9.18 to no.
    dns proxy = no
    netbios name = JAA-MAGEIA
    log level = 1
    hosts allow = 192.168.1.
[homes]
    comment = Home Directories
    browseable = no
    writable = yes
[printers]
    comment = All Printers
    path = /var/spool/samba
    browseable = no
    # to allow user 'guest account' to print.
    guest ok = yes
    writable = no
    printable = yes
    create mode = 0700
    # =====================================
    # print command: see above for details.
    # =====================================
    print command = lpr-cups -P %p -o raw %s -r # using client side printer drivers.
    #   print command = lpr-cups -P %p %s # using cups own drivers (use generic PostScript on clients).
    # If you install drivers on the server, you will want to uncomment this so
    # clients request the driver
    use client driver = yes
[print$]
    path = /var/lib/samba/printers
    browseable = yes
    write list = @adm root
    guest ok = yes
    inherit permissions = yes
[pdf-gen]
    path = /var/tmp
    guest ok = No
    printable = Yes
    comment = PDF Generator (only valid users)
    printing = bsd
    #print command = /usr/share/samba/scripts/print-pdf file path win_path recipient IP &
    print command = /usr/share/samba/scripts/print-pdf "%s" "%H" "//%L/%u" "%m" "%I" "%J" &
    lpq command = /bin/true
;[tmp]
;   comment = Temporary file space
;   path = /tmp
;   read only = no
;   public = yes
;[public]
;   comment = Public Stuff
;   path = /home/samba/public
;   public = yes
;   writable = no
;   write list = @staff
;[fredsprn]
;   comment = Fred's Printer
;   valid users = fred
;   path = /homes/fred
;   printer = freds_printer
;   public = no
;   writable = no
;   printable = yes
;[fredsdir]
;   comment = Fred's Service
;   path = /usr/somewhere/private
;   valid users = fred
;   public = no
;   writable = yes
;   printable = no
;[pchome]
;  comment = PC Directories
;  path = /usr/pc/%m
;  public = no
;  writable = yes
;[myshare]
;   comment = Mary's and Fred's stuff
;   path = /usr/somewhere/shared
;   valid users = mary fred
;   public = no
;   writable = yes
;   printable = no
;   create mask = 0765
[NewVolume]
    path = /mnt/newvolume
    comment = NewVolume
    public = yes
    writable = yes
    guest ok = yes


The restart-button seems to have something funny in it too:
(reconfigured - changed the netbios name - and restarted)
Code: Select all
        \\JAASMB         
cli_start_connection: failed to connect to JAASMB<20> (0.0.0.0). Error NT_STATUS_BAD_NETWORK_NAME
        \\JAA-MAGEIA     
cli_start_connection: failed to connect to JAA-MAGEIA<20> (0.0.0.0). Error NT_STATUS_BAD_NETWORK_NAME

Code: Select all
[root@localhost samba]# ps axu | grep smbd
root      1380  0.0  0.0  11404  1140 ?        S    Oct02   0:00 /bin/bash -c ulimit -S -c 0 >/dev/null 2>&1 ; smbd -D
root      1382  0.0  0.1 120592  5804 ?        S    Oct02   0:00 smbd -D
root     30819  0.0  0.1 109272  4132 ?        Ss   00:13   0:00 smbd -D
root     30825  0.0  0.0 109788  2572 ?        S    00:13   0:00 smbd -D
root     30964  0.0  0.0 105180   960 pts/1    S+   00:16   0:00 grep --color smbd


Got rid of the older \\JAA-MAGEIA when I hand-killed nmbd and both smbds and then restarted samba from the draksambashare.
Last edited by turboscrew on Oct 2nd, '14, 23:58, edited 2 times in total.
Mageia 4.1 on GA-B75M-D3H / Intel i3-3220 CPU @ 3.30GHz RAM: 4GB
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland

Re: Setting up Samba

Postby turboscrew » Oct 2nd, '14, 23:29

Tried without any smb.conf - No way, neither with MCC icon nor command line.
Not even with empty smb.conf.
(I guess it even shouldn't...)
Mageia 4.1 on GA-B75M-D3H / Intel i3-3220 CPU @ 3.30GHz RAM: 4GB
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland

Re: Setting up Samba

Postby turboscrew » Oct 3rd, '14, 00:00

I've begun to wander if I should reinstall the whole Mageia...
Maybe I've already messed it up...

Well, at least I'm giving Mageia a monkey-test. ;-)
Mageia 4.1 on GA-B75M-D3H / Intel i3-3220 CPU @ 3.30GHz RAM: 4GB
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland

Re: Setting up Samba

Postby jkerr82508 » Oct 3rd, '14, 00:44

turboscrew wrote:I've begun to wander if I should reinstall the whole Mageia...

That should not be necessary. I think that you should investigate the error:
Server requested LANMAN password (share-level security) but 'client lanman auth = no' or 'client ntlmv2 auth = yes'

These threads may give you some ideas:
http://www.linuxquestions.org/questions ... ed-878088/
http://www.linuxquestions.org/questions ... 175419138/

A google search for "server requested lanman password (share-level security)" displays several other references.

Jim
jkerr82508
 
Posts: 946
Joined: Mar 26th, '11, 01:34
Location: Fife, Scotland

Re: Setting up Samba

Postby turboscrew » Oct 3rd, '14, 10:37

Looks like I manual changes are needed?
The draksambashare doesn't seem to handle that?

wins-support seems to be another manual thing.

[EDIT]
Added the lines
Code: Select all
client lanman auth = Yes
lanman auth = yes

restarted samba, but no change.
Anyway, it looks like it's somehing connected to the changes (defaults, maybe) in the "newer" varsion of Samba.
Last edited by turboscrew on Oct 3rd, '14, 11:11, edited 1 time in total.
Mageia 4.1 on GA-B75M-D3H / Intel i3-3220 CPU @ 3.30GHz RAM: 4GB
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland

Re: Setting up Samba

Postby doktor5000 » Oct 3rd, '14, 10:56

turboscrew wrote:[root@localhost samba]# smbclient -L \\localhost
WARNING: The security=share option is deprecated
Enter root's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.24]
Server requested LANMAN password (share-level security) but 'client lanman auth = no' or 'client ntlmv2 auth = yes'
tree connect failed: NT_STATUS_ACCESS_DENIED


Well, that could be a red herring. Basically smbclient -L does an "anonymous" login. So if there's no public & browseable share or a share that allows for read access to everybody,
then you could see similar errors. Please try again, and supply a valid samba user to
Code: Select all
smbclient -L \\localhost -U username


We even had a loosely related thread about this: viewtopic.php?f=25&t=4556
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18052
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Setting up Samba

Postby turboscrew » Oct 3rd, '14, 11:18

Code: Select all
[root@localhost samba]# smbclient -L \\localhost -U jaa     
WARNING: The security=share option is deprecated
Enter jaa's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.24]
Server requested LANMAN password (share-level security) but 'client lanman auth = no' or 'client ntlmv2 auth = yes'
tree connect failed: NT_STATUS_ACCESS_DENIED

A-ha I seem to have overwritten my 'lanman-lines' with the draksambashare.
Mageia 4.1 on GA-B75M-D3H / Intel i3-3220 CPU @ 3.30GHz RAM: 4GB
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland

Re: Setting up Samba

Postby turboscrew » Oct 3rd, '14, 11:23

Now this is weird:

Code: Select all
[root@localhost samba]# smbclient -L \\localhost -U jaa
WARNING: The security=share option is deprecated
Enter jaa's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.24]
Server requested LANMAN password (share-level security) but 'client lanman auth = no' or 'client ntlmv2 auth = yes'
tree connect failed: NT_STATUS_ACCESS_DENIED


but in the smb.conf:
Code: Select all
    client lanman auth = yes
    lanman auth = yes
    guest account = jaa


And yes, I did restart samba after changes.
Mageia 4.1 on GA-B75M-D3H / Intel i3-3220 CPU @ 3.30GHz RAM: 4GB
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland

Re: Setting up Samba

Postby doktor5000 » Oct 3rd, '14, 14:42

Did you check the two links that Jim posted previously, especially the second one? Also, you mentioned a hostname change in smb.conf.
You know that smb protocol is quite sensitive to that? E.g. if the unix hostname differs from the netbios hostname, or if the local nameresolution is not working correctly,
you may need to specify different options for smbclient. E.g. try against localhost, 127.0.0.1, actual IP adress and actual hostname ...
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18052
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Setting up Samba

Postby turboscrew » Oct 3rd, '14, 16:17

You know that smb protocol is quite sensitive to that?

That I didn't know.

Should this tell me something?
Code: Select all
[root@localhost samba]# pdbedit -L -w
WARNING: The security=share option is deprecated
jaa:500:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[U          ]:LCT-00000000:
Last edited by turboscrew on Oct 3rd, '14, 16:31, edited 1 time in total.
Mageia 4.1 on GA-B75M-D3H / Intel i3-3220 CPU @ 3.30GHz RAM: 4GB
turboscrew
 
Posts: 75
Joined: Aug 3rd, '14, 11:49
Location: Nokia (town) Finland

Re: Setting up Samba

Postby doktor5000 » Oct 3rd, '14, 16:27

You may want to read up on that: https://www.samba.org/samba/docs/using_samba/ch07.html or maybe the linked O'Reilly book http://docstore.mik.ua/orelly/samba/
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18052
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Next

Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest