Avatar of Greg Alexander
Greg Alexander
Flag 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?
Linux NetworkingWindows XPLinux OS Dev

Avatar of undefined
Last Comment
raysonlee

8/22/2022 - Mon
pilson66

add "global section", like this:

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

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
raysonlee

have u configure how users are going to authenticate themselves to use the Samba share directory?
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
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 :(
pilson66

in share section, change "public" from "no" to "yes" and restart samba.
raysonlee

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
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Greg Alexander

ASKER
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
pilson66

smbpasswd -a username
Greg Alexander

ASKER
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?
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
pilson66

add user
then in windows enter username and password, entered in smbpasswd
pmasotta

Greg Alexander

ASKER
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 :(
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
raysonlee

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
Greg Alexander

ASKER
[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 :(
Greg Alexander

ASKER
Something now, when I use testparm -v it only shows this:

        path = /var/www/html/
        read only = No
        guest ok = Yes
Your help has saved me hundreds of hours of internet surfing.
fblack61
raysonlee

try remove the line "comment = "
and the '/' at the end of path
i.e. path = /var/www/html
Greg Alexander

ASKER
Nothing still
raysonlee

where do u put your smb.conf file?
try
  testparm -v /<fullpath>/smb.conf
to make sure you are testing the correct configuration file
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Greg Alexander

ASKER
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
raysonlee

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question