Link to home
Create AccountLog in
Avatar of Greg Alexander
Greg AlexanderFlag for United States of America

asked on

Configure Samba server via command line Linux CentOS

I am trying to get samba working on centOS... I installed it via Yum, changed the samba config file to:

[ShareName]
        path = /var/www/html/
        public = no
        writable = yes
        printable = no
        create mask = 0765
        valid users = username

Restarted samba and it did nothing.. the windows network is not seeing the share at all. I realize there is most likely something I am missing but I have always done it with the GUI, but unable to do that this time.. Any pointers?
Avatar of pilson66
pilson66
Flag of Ukraine image

add "global section", like this:

[global]
    netbios name = comp1
    server string =
    workgroup = HOME
    security = user
    smb ports = 139
and change "public" to "yes"
example2:

[Share]
    create mask = 0660
    directory mask = 0770
    comment =
    path = /home/pilson/Share
    read only = no
    available = yes
    browseable = yes
    writable = yes
    guest ok = yes
    public = yes
    printable = no
    locking = no
    strict locking = no
Avatar of raysonlee
raysonlee

have u configure how users are going to authenticate themselves to use the Samba share directory?
Avatar of Greg Alexander

ASKER

@raysonlee: I don't suppose so, don't care if it is wide open for that matter... I didn't think you could not require a login because windows forced a login

@pilson66: I assume I need to change the values on the global section

[global]
    netbios name = comp1
    server string =
    workgroup = HOME
    security = user
    smb ports = 139

not sure what they need to be... I am noob at this, for instance I have no clue what my netbios name is :(
in share section, change "public" from "no" to "yes" and restart samba.
you have to create samba username and passwords for your users,
 useradd -s /bin/true username
 smbpasswd -L -a username
 smbpasswd -L -e username
use the same username and password as Windows so that the users don't have to enter them again when connect to Samba share directory
try use \\ipaddress\sharename instead of server name to make sure it's not DNS / NETBIOS issue
I disabled iptables and I am now able to see the share but when I am not able to get into them, it seems that the username and password worked but I don't think I am able to browse it so I added browsable = yes and that didn't work :( I wish I could just not allow a login, anyway
smbpasswd -a username
That changes the password of the username? I did and it did nothing.. I wander if the windows user does not have access to it?
add user
then in windows enter username and password, entered in smbpasswd
I added user and password and used at the windows prompt... the prompted goes away as if I got it correct (I also typed it in wrong and it told me I did).. now I see the share and can get to it without login and but when I double click on it, windows says it can find 192.168.1.4 but can't find Share (which is the name of the share)

Any ideas?

@pmasotta - that didn't really help my situation :(
what are the settings of your [share] section?
have u add your user name in the valid users entry?
to make sure u used the "valid users" instead of guest account, try reboot your PC and map the drive again
[Share]
    create mask = 0660
    directory mask = 0770
    comment =
    path = /var/www/html/
    read only = no
    available = yes
    browseable = yes
    writable = yes
    guest ok = yes
    public = yes
    printable = no
    locking = no
    strict locking = no
    valid users = testuser

I restarted my cpu and still nothing :(
Something now, when I use testparm -v it only shows this:

        path = /var/www/html/
        read only = No
        guest ok = Yes
try remove the line "comment = "
and the '/' at the end of path
i.e. path = /var/www/html
Nothing still
where do u put your smb.conf file?
try
  testparm -v /<fullpath>/smb.conf
to make sure you are testing the correct configuration file
Yeah it was correct... one question... If I created a Linux user and a samba user, do I need a windows account to match?
ASKER CERTIFIED SOLUTION
Avatar of raysonlee
raysonlee

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account