1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.


Discussion in 'Linux / Unix Discussion' started by zimbo, Jun 12, 2006.

  1. zimbo
    Honorary Member

    zimbo Petabyte Poster

    Im going to show you a very simple demonstration on what the magic of samba can do. This is just a very tiny example and it is not by all means best practise methods. Your server will be insecure so this is not suitable for enterprise enviroments - like i said its to show you what samba can do.

    Im assuming for you to be trying this you must either know a little linux or learning as you going along - i will be using debian as the distro.

    First of all make sure you have the samba package installed if not:

    apt-get install samba
    After the packages have been obtained a short set up routine will automatically start. Answer the prompts as follows:

    • Enter your Workgroup or Domain name
    • Answer Yes to encrypted passwords
    • Answer No to "get WINS settings from DHCP" - assuming you are running a DHCP server (i.e. from a router like me)
    • Choose to run Samba as daemons
    • Answer Yes to create the Samba passwords file

    The Samba configuration files were installed in the following directory:

    Now using your favourite text editor edit the smb.conf file for example:
    vi /etc/samba/smb.conf
    And make the following changes in BOLD BLUE:

       workgroup = YOURWORKGROUPNAME
       server string = %h server (Samba %v)
    ;   wins support = no
    ;   wins server = w.x.y.z
       dns proxy = no
    ;   name resolve order = lmhosts host wins bcast
       log file = /var/log/samba/log.%m
       max log size = 1000
    ;   syslog only = no
       syslog = 0
       panic action = /usr/share/samba/panic-action %d
       security = share
       encrypt passwords = true
       passdb backend = tdbsam guest
       obey pam restrictions = yes
    ;   guest account = nobody
       invalid users = root
    ;   unix password sync = no
       passwd program = /usr/bin/passwd %u
       passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .
    ;   pam password change = no
    [COLOR="Blue"][B]   load printers = yes
       printing = bsd
       printcap name = /etc/printcap[/B][/COLOR]
    ;   printing = cups
    ;   printcap name = cups
    ;   printer admin = @ntadmin
       [COLOR="Blue"][B]preserve case = yes
       short preserve case = yes[/B][/COLOR]
    ;   include = /home/samba/etc/smb.conf.%m
       socket options = TCP_NODELAY
    ;   message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &
    ;   domain master = auto
    ;   idmap uid = 10000-20000
    ;   idmap gid = 10000-20000
    ;   template shell = /bin/bash
       comment = Shared Files
       path = /home/ftp
       writable = yes
       guest ok = yes[/COLOR][/B]
       comment = Home Directories
       browseable = no
       writable = no
       create mask = 0700
       directory mask = 0700
    ;   comment = Network Logon Service
    ;   path = /home/samba/netlogon
    ;   guest ok = yes
    ;   writable = no
    ;   share modes = no
       comment = All Printers
       browseable = [COLOR="Blue"][B]yes[/B][/COLOR]
       path = /tmp
       printable = yes
       public = [COLOR="Blue"][B]yes[/B][/COLOR]
       writable = [B][COLOR="Blue"]yes[/COLOR][/B]
       create mode = [COLOR="Blue"][B]0777[/B][/COLOR]
       comment = Printer Drivers
       path = /var/lib/samba/printers
       browseable = yes
       read only = yes
       guest ok = no
    ;   write list = root, @ntadmin
    ;   comment = Samba server's CD-ROM
    ;   writable = no
    ;   locking = no
    ;   path = /cdrom
    ;   public = yes
    ;   preexec = /bin/mount /cdrom
    ;   postexec = /bin/umount /cdrom
    Now i suggest you restart the operating system.

    Next you should add a new user using the adduser command and give the details you are asked.
    You will now have to assign this users samba password so:

    smbpasswd -a [I]username[/I]
    and provide a password.

    Now login into the debian system using the user you just create using their normal credentials. Create a folder in that users /home directory and assign the user
    chmod u+wrx
    Now on a Windows machine make sure that Windows client is on the same IP range and that it has the same workgroup name as the debian machine. Open Network Places and there should be a machine with the name of the debian machine. Double click and enter your username and SAMBA password you created. And you will see you can now read,write and store all your files on the linux server.
    Certifications: B.Sc, MCDST & MCSA
    WIP: M.Sc - Computer Forensics
  2. Mitzs
    Honorary Member

    Mitzs Ducktape Goddess

    I'm not a Linux user myself, but I would think this would be great for those that are just starting out. But I know someone that might have a use for this down the road. I will pass it on to them. Thanks for taking the time to do this zimbo. :thumbleft :thumbleft
    Certifications: Microcomputers and network specialist.
    WIP: Adobe DW, PS
  3. zimbo
    Honorary Member

    zimbo Petabyte Poster

    by all means mitz post it where you want and tell everyone! I know i take them to the *daft-level* but thats who im hoping will read them... someone starting out and needing to be shown everything.
    Certifications: B.Sc, MCDST & MCSA
    WIP: M.Sc - Computer Forensics

Share This Page