rianto isaac's Weblog

rianto utomo isaac sahala utomo

linux, SAMBA easy

leave a comment »

Samba is an open source project that allows Windows users to connect to a Linux server from which to share data. If you are looking for a simple, affordable home file server, or need more disk space on your office network, a Linux server with Samba is the way to go. Linux along with Samba offers a stable, secure environment that is available at no cost, along with features such as remote administration, immunity to Windows viruses, and the ability to run on low-end machines. Here’s how you can set up a simple Samba server on Slackware for SOHO use.

Most current Linux distributions, including Slackware 11, have Samba already installed and running after the system boots. This article assumes that Samba has been installed. The commands work for Slackware version 11 and 10.2, and likely many other Linux distros.

The first step is to create a share folder on your hard drive; for instance, /disk2/data. After that, you need to edit the smb.conf file, found in /etc/samba, and make it look something like this:

# Global parameters
[global]
       workgroup = HOME
       netbios name = SAMBA
       server string = Samba Server %v
       map to guest = Bad User
       log file = /var/log/samba/log.%m
       max log size = 50
       socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
       preferred master = No
       local master = No
       dns proxy = No
       security = User

# Share
[Data]
       path = /disk2/data
       valid users = joel
       read only = No
       create mask = 0777
       directory mask = 0777

You can copy and paste this into your conf file or make changes to your existing one.

The workgroup name needs to be the workgroup of your Windows computers, or your domain name. The netbios name is what will appear when you access the Linux computer from Windows. I am currently running a Windows domain with this setup, so I have the preferred master and local master set to no to avoid both servers from attempting to be the master browser. This will eliminate network conflicts on your Windows computers that can cause network-related outages.

For the share details, specify the valid users, or set them up later. In that section you can allow users to create their own folder and files for all to access.

The next step is to add users by the following command:

# useradd -c "Joel Nahrgang" joel
# smbpasswd -a joel
New SMB password: secret
Reenter SMB password: secret
Added user joel

Next, run the testparm command to ensure that the conf file is valid. If it returns no errors, restart Samba with the command/etc/rc.d/rc.samba restart. You should also make Samba executable when the server is rebooted with the command chmod 755 /etc/rc.d/rc.samba.

If you would like to tidy up your smb.conf file, the following commands will back up the file, then remove all the comments for easier reading:
# cd /etc/samba
# cp -a smb.conf smb.conf.master
# testparm -s smb.conf.master > smb.conf

Now you’re ready to test Samba. On a Windows computer, you can either map a drive to the Samba server or access the drive using the Start-Run command and typing \\Samba\data, “Samba” being the server name and “data” being the shared folder.

rianto utomo bole nyontek dari http://www.linux.com/articles/58593

Written by isaaconi

Mei 4, 2009 pada 4:02 am

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: