Basic Samba server :)

ally_ukally_uk Member Posts: 1,145 ■■■■□□□□□□
Has anyone set one up? this is proving to be quite a mission for myself there doesn't appear to be a simple solution, Documentation varies some go on about disabling Selinux, Others go on about editing firewall rules, Haha i'm just trying to create a simple share on a Red hat box and getting it to the stage that Windows 7 can see it.

That's my one pet hate about Linux, If I was using a Microsoft product bang it would be done no hassle no trawling through numerous documentation, Ending up with headaches, Isn't it about time they unified the approach to configuration. I don't really want to go down the route of using GUI tools like SWAT,

Just need a plain English step by step simple samba guide in which I can have something running this year haha
Microsoft's strategy to conquer the I.T industry

" Embrace, evolve, extinguish "

Comments

  • undomielundomiel Member Posts: 2,818
    Connecting to a samba share from Vista/7 is a bit of a pain. As I recall you need to disable SMB packet signing on the clients. I'd first go for getting it working with XP (if that's an option) then graduate to 7.
    Jumping on the IT blogging band wagon -- http://www.jefferyland.com/
  • demonfurbiedemonfurbie Member Posts: 1,819
    id suggest turning off the windows 7 firewall and try again, once ya get it working with the firewall off then you can set up the correct config on the windows firewall
    wgu undergrad: done ... woot!!
    WGU MS IT Management: done ... double woot :cheers:
  • ally_ukally_uk Member Posts: 1,145 ■■■■□□□□□□
    Ok getting somewhere it much not be the most complicated configuration but the foundations are there

    [global]
    workgroup = workgroup
    security = SHARE
    [Plans]
    path = /plans
    read only = Yes
    guest ok = Yes

    Can access the share from windows 7, But cannot create any files permisson problem right?

    chkconfig - ensure that both smb and nmb are running, enable both in the gui if not.

    Disable SElinux - /etc/selinux edit the config file and set SELINUX to disabled

    Edit lmhosts and add the ip address of the windows box

    :)
    Microsoft's strategy to conquer the I.T industry

    " Embrace, evolve, extinguish "
  • demonfurbiedemonfurbie Member Posts: 1,819
    try as root chmod 777 (dir name here) that should help with permissions
    wgu undergrad: done ... woot!!
    WGU MS IT Management: done ... double woot :cheers:
  • undomielundomiel Member Posts: 2,818
    Personally I would first try setting "read only" to no.
    Jumping on the IT blogging band wagon -- http://www.jefferyland.com/
  • W StewartW Stewart Member Posts: 794 ■■■■□□□□□□
    After you install samba then you need to edit the samba.conf file. Most of the configuration is already there for you. Just change the workgroup to whatever your using on your windows network. At the bottom, there is a directory called public. Use that as an example to create a directory that you can share and name the share whatever you want to name it. Create a regular linux account on the linux box for the windows box to use and then use command "smbpasswd -a [username]" and add a samba password for that user. Restart the smb service for good measure. At this point the firewall and selinux should be the only thing stopping you from accessing the samba share from a windows box. If you just want to test it out you can stop iptables with "service iptables stop" and disable selinux with "setenforce 0". If you plan on actually using it, I would recommend configuring iptables and selinux for secuirty. You just need to open port 445 tcp/udp, ports 137-138 udp and port 139 tcp. for selinux you will need to use the command "setsebool enable_home_dirs on" .I've read instructions that say to run "chcon -t samba_share_t /[share directory]" But that doesn't usually work out for me and what works for me is running "restorecon -R /[share directory]". I would recommend learning about getsebool and setsebool at least as those are pretty simple to understand once you take a look at it but you can also benefit greatly from learning about semanage, chcon and restorecon as well. Selinux becomes a lot less of a pain to deal with once you learn to understand it and the same goes for iptables. It will make life a lot easier when trying to get network applications to work and you don't have to compromise the security of your system.
  • W StewartW Stewart Member Posts: 794 ■■■■□□□□□□
    Actually this guide can probably give you a more human readable explanation. It's for centos but it should work with redhat. It may tell you to use semanage. If you don't have that tool you can either install it or just use "chcon -t samba_share_t /[directory]". It's Centos but it should still be the same setup for red hat.

    http://wiki.centos.org/HowTos/SetUpSamba
  • W StewartW Stewart Member Posts: 794 ■■■■□□□□□□
    Almost forgot. It should work smoothly with Windows 7 but if you're using vista you have to change some security policies with secpol.msc because vista sucks, and if you have a home version then you have to hack some registry settings.


    Get Vista and Samba to work | TechRepublic
  • W StewartW Stewart Member Posts: 794 ■■■■□□□□□□
    ally_uk wrote: »
    Ok getting somewhere it much not be the most complicated configuration but the foundations are there

    [global]
    workgroup = workgroup
    security = SHARE
    [Plans]
    path = /plans
    read only = Yes
    guest ok = Yes

    Can access the share from windows 7, But cannot create any files permisson problem right?

    chkconfig - ensure that both smb and nmb are running, enable both in the gui if not.

    Disable SElinux - /etc/selinux edit the config file and set SELINUX to disabled

    Edit lmhosts and add the ip address of the windows box

    :)

    I must have missed this. You have read only set to yes. Fix that and it should work. Other than that I would just recommend getting selinux and iptables to work since security is essential for any server.
  • ally_ukally_uk Member Posts: 1,145 ■■■■□□□□□□
    Hey thanks for the replies, I am currently very new to Red Hat and Linux in general so am just dipping my toes into the water, I have disabled SElinux for now. I do have Micheal Jangs Red Hat book and will be crossing that bridge once I have the foundations in place.

    So I have got the above basic share working, Next stage for me will be learning about creating users and authentication was going to have a dabble and implement tbdsam.

    W stewart you sound like you know your stuff :) are you a RHCSE? if not whynot?
    Microsoft's strategy to conquer the I.T industry

    " Embrace, evolve, extinguish "
  • W StewartW Stewart Member Posts: 794 ■■■■□□□□□□
    ally_uk wrote: »
    Hey thanks for the replies, I am currently very new to Red Hat and Linux in general so am just dipping my toes into the water, I have disabled SElinux for now. I do have Micheal Jangs Red Hat book and will be crossing that bridge once I have the foundations in place.

    So I have got the above basic share working, Next stage for me will be learning about creating users and authentication was going to have a dabble and implement tbdsam.

    W stewart you sound like you know your stuff :) are you a RHCSE? if not whynot?

    I'm planning on going for the RHCSA maybe within the next year but for now i'm mostly putting it off because of budgeting and financial reasons. That and I want to at least knock out the CCNA first for school so I don't have to worry about it.
Sign In or Register to comment.