Setting up Samba shares

Setting up Samba shares

Postby phil1349 » Dec 1st, '16, 21:52

I am new to Mageia although I have used Mandrake/Mandriva in the past and Mageia does not seem that different to what I remember but I am having problems setting up Samba shares on Mageia. I have been through the procedures in Mageia Control Center but nothing happens, no network share.

I am probably missing something simple so if anyone can suggest what is wrong or point me to a good "howto" I will be grateful.
phil1349
 
Posts: 11
Joined: Dec 1st, '16, 21:16

Re: Setting up Samba shares

Postby Germ » Dec 1st, '16, 22:01

Welcome to Mageia. :mrgreen:

Have a look here: https://doc.mageia.org/mcc/3/en/content ... share.html
Starting in 1999: Mandrake > Mandriva > Mageia
Linux User #274693
User avatar
Germ
 
Posts: 582
Joined: Mar 30th, '11, 13:16
Location: Chelsea, Oklahoma USA

Re: Setting up Samba shares

Postby xboxboy » Dec 2nd, '16, 00:47

I often forget to relax the firewall to allow samba shares.
xboxboy
 
Posts: 391
Joined: Jun 2nd, '13, 06:41

Re: Setting up Samba shares

Postby phil1349 » Dec 2nd, '16, 02:20

I set things up exactly as per the howto and the firewall is off but still nothing.
phil1349
 
Posts: 11
Joined: Dec 1st, '16, 21:16

Re: Setting up Samba shares

Postby wintpe » Dec 2nd, '16, 18:00

when you say nothing, its not much help
something might have happened that gives us a clue why it appears to not work for you.

a much better description of what you perceive is not working.

so lets start with some hints, of what we would like to see.

what are you sharing, and what is it sharing to, for example is the system looking at the share, also mageia or windows, and what version.

open up a terminal.


Code: Select all
su -

type rootpassword

ps -ef|grep smbd

ps -ef|grep nmbd

cat /etc/samba/smb.conf|grep -v ^#|grep -v ^\;


(put it in CODE blocks please, otherwise you will have the CODE police on to you).

what username are using on the windows system (if its windows you are sharing to.)

regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: Setting up Samba shares

Postby phil1349 » Dec 3rd, '16, 17:29

I need to setup Windows sharing not only to share files with other computers, which may or may not be windows based, and more importantly to transfer images from my camera (which only does smb protocols) via Wi-Fi.

What happens is that I start with Control centre > Share directories with Windows (smb) systems > complete wizard, all simple and straightforward but no share accessible even after a reboot.

Next I went to Dolphin file manager, right-click the desired directory (Pictures in this case) > Properties > Share > tick share and Allow Guest boxes & everyone to Full Control, click OK & the directory icon is now overlaid with the network globe symbol. But no share is available,also if a different directory is viewed in Dolphin if I then return to the home page, the network symbol has disappeared.

Here are the results as indicated :-

Code: Select all
ps -ef|grep smbd                               
root      1870     1  0 13:41 ?        00:00:00 smbd -D
root      1889  1870  0 13:41 ?        00:00:00 smbd -D
root      7332  7270  0 15:06 pts/1    00:00:00 grep --color smbd



Code: Select all
ps -ef|grep nmbd         
root      1880     1  0 13:41 ?        00:00:00 nmbd -D
root      7349  7270  0 15:06 pts/1    00:00:00 grep --color nmbd


and finally

Code: Select all
 cat /etc/samba/smb.conf|grep -v ^#|grep -v ^\;

[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 = M5 browseable = no
   
    # 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. browseable = no
    #  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 browseable = no
    #  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 = Mag5




[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
[Pictures]
    path = /home/phil/Pictures
    comment = Pictures


Pictures has been added to smb.conf so why no sharing ?

Regards Phil1349
phil1349
 
Posts: 11
Joined: Dec 1st, '16, 21:16

Re: Setting up Samba shares

Postby wintpe » Dec 5th, '16, 11:37

I personalty dont use guis to set stuff up, and so im not sure why
the mageia gui has done this, but it has not added browsable = yes, which means you wont ever see it.

you should be able to blindly connect to it though, from a windows host.

windows 7 8 and 10, have to be configured to see shares, as by default they block network browsing, to
save windows users from themselves.

also workgroup = Workgroup

if this is not set to the same as all the other boxes, it can make finding stuff difficalt, so change this to
whatever domain your other hosts have.

you can use smbclient -L hostname to see what your system is sharing.

regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: Setting up Samba shares

Postby phil1349 » Dec 8th, '16, 16:44

I have added "browsable = yes " to smb.conf but it has not made any difference. I cannot blindly connect to the share either although the output from "smbclient -L hostname"
Code: Select all
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.25]

        Sharename       Type      Comment
        ---------       ----      -------
        print$          Disk     
        pdf-gen         Printer   PDF Generator (only valid users)
        Pictures        Disk      Pictures
        IPC$            IPC       IPC Service (Samba 3.6.25)
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.25]

        Server               Comment
        ---------            -------
        MAG5                 Samba 3.6.25

        Workgroup            Master
        ---------            -------
        WORKGROUP


indicates all present and correct. I tried a *buntu and Mint boxes and after running through the gui the share appeared and worked normally.

I can only conclude that samba has got badly broken somewhere. This may be because I upgraded from 4 > 5 via an over-the-net upgrade and I know from previous experience with *buntu net upgrades that they can sometimes go pear-shaped. Maybe I need to try a clean install.

Regards phil1349
phil1349
 
Posts: 11
Joined: Dec 1st, '16, 21:16

Re: Setting up Samba shares

Postby wintpe » Dec 8th, '16, 17:55

lets not conclude anything, lets be engineers and diagnose the problem.

smbclient shows that "samba is working correctly"

what may not be working correctly is the firewall, or your configuration of it or the systems you are testing from

1 test at a time, to break the problem down to its specific part, no guesses.

so the next thing i want you to do is run that same smbclient from another system
and make \\servername your mageia box.

lets see what that says.

also

iptables -L please on your mageia box.

also on the other box run

nmap mageiasystemname

just some basic tests can get to the bottom of problems like this


regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: Setting up Samba shares

Postby jiml8 » Dec 8th, '16, 21:40

It is never necessary to reinstall linux. You can always fix it. This isn't Windows, after all...
jiml8
 
Posts: 1253
Joined: Jul 7th, '13, 18:09

Re: Setting up Samba shares

Postby phil1349 » Dec 8th, '16, 22:12

Progress at last !

Whwn trying other systems I checked the router status to be sure that all systems were connected. I noticed that the *buntu & mint boxes showed the same name on the router list as the samba server name. The Mageia box had "U1504" for the router id but "Mag5" as the samba name. Both must be system defaults as I never entered either.

smbclient -L Mag5 on the *buntu box failed to connect but changing Mag5 to U1504 gave the following output which seems to indicate a normal connection.

Code: Select all
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.25]

        Sharename       Type      Comment
        ---------       ----      -------
        IPC$            IPC       IPC Service (Samba 3.6.25)
        Pictures        Disk      Pictures
        pdf-gen         Printer   PDF Generator (only valid users)
        print$          Disk     
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.25]

        Server               Comment
        ---------            -------
        K12042LTS            K12042LTS server (Samba, Ubuntu)
        MAG5                 Samba 3.6.25

        Workgroup            Master
        ---------            -------
        HOME                 BTHUB5
        WORKGROUP            MAG5


Going back to the *buntu box, clicking "Samba Shares" > Workgroup shows the server names as above but it cannot connect to Mag5. If I now manually edit the location bar to replace Mag5 with U1504 it connects immediately & I can read the Pictures share but cannot yet write to it. This will be important for connecting the camera to transfer pics in future. I edited smb.conf to change the Netbios name to U1504, (the line server string = Mag5 is & has always been commented out), rebooted but it still shows up as Mag5 under Workgroup.

If I can solve the name problem then that should resolve the situation.

Regards Phil
phil1349
 
Posts: 11
Joined: Dec 1st, '16, 21:16

Re: Setting up Samba shares

Postby wintpe » Dec 9th, '16, 00:06

the thing is with server message block protocol, because it was written by microsoft
on top of netbios, it does not follow all the rules we come to see in unix.

unix uses dns names, ie a ip to name lookup system to identify systems.

smb just uses names, but needs those names to be consistent with the ipaddress.

so what is the mga5 box known as to the other systems, it has to be consistent otherwise you get difficult to diagnose problems.

the username used in unix also has to match consistently across all the systems, and u need the samba option writable = yes, to enable write
and that the underlying filesystem is writable to that user.

read the docs on samba, and smb.conf threes loads of config options for each share.

like force user = peter for example, which tunes all files to peters ownership, even if claire wrote them.

but claire would have to have a unix account and be in the valid users = claire, peter line as well.

also should use smbpasswd to setup user authentication for each unix user.

then if the user is peter who is connecting, the files and directories that samba is sharing also need to be owned by peter

it goes on, ..... samba is a cludge on unix to provide interoperability between windows and unix.

it is not unix's native network sharing system.

thats NFS, and nfs to nfs unix works fantastically, without these issues.

anyway, i. think you are developing the knowledge to get to the bottom of this now

and theres always man smb.conf

regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: Setting up Samba shares

Postby phil1349 » Dec 10th, '16, 21:36

Still not resolved the problem.
I am sure that wintpe is correct in that is an identification problem. Most other distros I have installed explicitly ask during installation for a label "by which it will be known to the network" This is the label it uses on the router status entry & to other boxes on the network - no problem.

Mageia does not ask for this information, it appears on the router as "u1504" and to the network as Mag5 but I cannot see where these labels have come from. I have edited smb.conf to change mag5 to u1504 in the Netbios name & server string lines but it does not make any difference. Other boxes automatically see it as Mag5 and refuse to connect unless I manually edit the address to u1504 when it will connect.

I also note that in a command prompt window the name defaults to "localhost" where other systems use the network name at the prompt. I tried editing the /etc/hostname file entry from localhost to u1504 but all this did was change Mag5 to Mag5(u1504).

So far, I cannot find any reference to either u1504 or mag5 on the system but if I can and then edit the appropriate files so they match then hopefully this should cure the problem.

Any other advice gratefully received.

Regards phil1349
phil1349
 
Posts: 11
Joined: Dec 1st, '16, 21:16

Re: Setting up Samba shares

Postby doktor5000 » Dec 10th, '16, 23:09

phil1349 wrote:Mageia does not ask for this information, it appears on the router as "u1504" and to the network as Mag5 but I cannot see where these labels have come from.

That's your hostname, either given to your box via DHCP by the router or set on your machine and passed on to the router.
Can you show the output of
Code: Select all
hostname -f
hostnamectl
cat /etc/hostname
cat /etc/hosts
cat /etc/sysconfig/network
grep -i hostname /etc/sysconfig/network-scripts/ifcfg-*
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: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Setting up Samba shares

Postby phil1349 » Dec 13th, '16, 00:40

In reply to doktor5000, I had assumed that the hostname reported by the router was the name assigned during installation as per previous experience with other linux distros and not given by the router. It now appears that "U1504" maybe assigned by the router as if I turn off WiFi and connect via wired ethernet the hostname is reported as "Unknown-bc-5f-f4-11-7a-bd" where the final string is the mac address.

I am now totally confused as every other box I have connected to a network, whether linux or windoze, ALWAYS reports the same hostname on the router and on the network irrespective of whether the connection is made via WiFi or wired ethernet so what is going on here ? Why is Mageia so different ?

The info requested by doktor500 ia as follows:

Code: Select all
hostname -f
localhost.home
[phil@localhost ~]$ hostnamectl
   Static hostname: localhost
         Icon name: computer-desktop
           Chassis: desktop
        Machine ID: 8b3c8bc3c406451c9e67671f49f33d44
           Boot ID: 8e1141f2eb034c3ea4759f79b5cbe4e6
  Operating System: Mageia 5
            Kernel: Linux 4.4.36-server-2.mga5
      Architecture: x86-64
[phil@localhost ~]$ cat /etc/hostname
localhost
[phil@localhost ~]$ cat /etc/hosts
# generated by drakhosts
# manually edited to change localhost to u1504
127.0.0.1 u1504
[phil@localhost ~]$ cat /etc/sysconfig/network
NETWORKING=yes
CRDA_DOMAIN=GB

[root@localhost phil]# grep -i hostname /etc/sysconfig/network-scripts/ifcfg-*
/etc/sysconfig/network-scripts/ifcfg-wlp0s2f1u2:NEEDHOSTNAME=no
/etc/sysconfig/network-scripts/ifcfg-wlp0s2f1u4:NEEDHOSTNAME=no



I hope this provides a clue.

Regards
Phil
phil1349
 
Posts: 11
Joined: Dec 1st, '16, 21:16

Re: Setting up Samba shares

Postby doktor5000 » Dec 13th, '16, 13:03

I cannot comment on how your router behaves.

But for the Mageia installation, no valid hostname is set (I don't consider localhost to be a valid hostname) and it's also not set to receive a hostname via DHCP from the router (controlled by the NEEDSHOSTNAME=no option)

So I'd suggest that you set one as root via
Code: Select all
hostnamectl set-hostname u1504

(if u1504 is what you prefer as hostname, I'd suggest some more meaningful names but that's out of topic here) and then reboot afterwards.
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: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Setting up Samba shares

Postby phil1349 » Dec 14th, '16, 01:02

I followed doktor5000's advice on setting hostname via hostnamectl set-hostname but it makes no difference. It still appears on the router as "u1504" on wi-fi and "unknown-etc" on ethernet. The only effect is on the login splash screen displays the new hostname.
phil1349
 
Posts: 11
Joined: Dec 1st, '16, 21:16

Re: Setting up Samba shares

Postby doktor5000 » Dec 14th, '16, 01:52

What particular router do you use? And you should probably also undo that change in your /etc/hosts
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: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Setting up Samba shares

Postby phil1349 » Dec 15th, '16, 17:51

My router is a standard router provided by my ISP, BT (British Telecom) and as far as I can find out, it is made to their specification by any one of 4 chinese sub-contractors. It works well and I have no complaints with it.
phil1349
 
Posts: 11
Joined: Dec 1st, '16, 21:16

Re: Setting up Samba shares

Postby doktor5000 » Dec 16th, '16, 12:38

Yeah, but what is the make/model of that thing? smart hub or home hub and what version?
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: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Setting up Samba shares

Postby phil1349 » Dec 16th, '16, 20:14

The full model name is a BT Home Hub 5 (Type A) and is currently running software version 4.7.5.1.83.8.222.1.1. It is supposedly a smart hub but I have my doubts even though it works OK.
phil1349
 
Posts: 11
Joined: Dec 1st, '16, 21:16

Re: Setting up Samba shares

Postby wintpe » Dec 21st, '16, 11:01

Hi Phil
I think the way your home hub (which quite frankly is not built for anything but windows and tablet users who have 1 pc and one tablet)
is assigning your hostnames is to put it frankly, rubbish.

I dont have/wont have a BT hh, so i dont know how to set them up.

but what we have here , and i think part of the problem, is your misunderstanding of whats going on on your network.

so lets talk infrastructure purist first.

A isc bind linux dhcp server, should ideally have what is called static dhcp, where it matches mac addresses to hostnames, that are defined in a named based dns server.

what happens then is all systems get the hostname you intend, and they keep the same ipaddress.

this is the hostname that the other systems think you are called, not the hostname set on your system, they can be different as you have seen.
and samba will get in a right pickle if they are different.

when you use one of these off the shelf isp provided nat routers, you take your chances how your operating system deals with that.

maybe if you get into your router you can set your dhcp hostnames against mac addresses, but i dont know.

what i would suggest is a much more robust solution, and exactly what i use at home, and thats to have a local dns/dhcp server.

you can do this with, any one of the cheap arm based mini systems, like a rasberry pie.

fedora/pidora is a os for rasberrypie 2 and 3 that very closely resembles mageia under the hood.

you would then disable dhcp in the bt hub, and have full control over how it hands out ipaddresses, and have a dependable
set of hostnames. with your bt router one replacement from them, or reset/firmware update and all your systems will get different ipaddresses
in fact that can happen any time, thats the nature of dynamic dhcp.

if you need help setting that up, i can post some config files, or do a howtododhcp/dns if we dont have one already, although the internet is probably awash with examples.

and you could add a harddisk drive to that pie, and make it a samba or nfs nas.

regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: Setting up Samba shares

Postby wintpe » Dec 23rd, '16, 11:58

last night, i updated my raspberypi's to fedora25 as i want to move my vpn from my asus dwrt system to a more upgradeable system
and now i have fibre BB, i want to upgrade my WAP's from abn to ac, so im re-using the asus for its original intended tsk.
it was very easy to do, and i did it from scratch.
The pi3, is about £35 for the board, bit extra for psu/box/msd
its very fast compared to the 1 and 2
and this will very easily run what i suggested.
if anyone wants, i can also do a howto openvpn, while im doing it.
regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: Setting up Samba shares

Postby doktor5000 » Dec 24th, '16, 01:40

wintpe wrote:if anyone wants, i can also do a howto openvpn, while im doing it.

I'd appreciate that :)
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: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Setting up Samba shares

Postby phil1349 » Dec 30th, '16, 01:50

Hi Wintpe, I hope you had a good time at Xmas, I think I did, now back to the
grindstone !

I am not so sure that it is the BT router that is assigning hostnames unless no
hostname is offered. The reason is the 2 different names assigned according to
whether I connected by WiFi or ethernet. I have never seen this before.

Issues connecting another device, a tv box which was quickly fixed, made me realise
that the router was remembering the last hostname associated with a MAC address. To
prove this point I tried another WiFi dongle I had and this was logged on the router
as "unknown-wifiMAC address" similar to the ethernet which logged as "unknown-ethernet
MAC address". The "U1504" is probably the hostname of a previous install using that
WiFi dongle.

I also had some spare disk capacity so a quick install of mint and on rebooting after
installation I set up smb networking and it all worked 100% straight out of the box no
problem using the hostname I entered at the start of installation.

I rebooted back to Mageia, rebooted the router, checked the connected screen and both
WiFi and ethernet showed the mint hostname. Changing back to the original dongle and
the router logged "U1504" again.

This proved to me that Mageia is for some reason not giving a hostname to the router
so it is not surprising that it cannot connect so I don't think a dedicated dhcp server
will solve the problem, it is also a complication I can do without at present.

Networking is functional, if I enter "smb://IP addr/share name/ it connects and
reads/writes to the shares as intended

So the question is why is Mageia not offering a hostname to the router and hence
the network as does windoze & every other linux distro I have tried ?

If I get the time I shall try to compare the start-up scripts & config files between
mint & mageia to see if I can spot anything but any tips on where to look would be gratefully received.

Regards
phil1349
phil1349
 
Posts: 11
Joined: Dec 1st, '16, 21:16

Next

Return to Networking

Who is online

Users browsing this forum: No registered users and 1 guest