»   »   »

Samba Setup for GNU/Linux


Samba is the tool to use if you want to allow access to your Linux files accessable from a Microsoft Windows PC or network.

Setting Samba via a GUI

On a Red Hat Linux system, you can use system-config-samba & to setup a samba share.

Setting Samba via the command-line

A simple example on a Red Hat server:

cat >>/etc/samba/smb.conf
        path = /opt/oracle
        writeable = yes
        guest ok = yes

Then set up the encrypted passwords:

smbpasswd -a oracle

And set up the master samba password:

smbclient -L servername

Finally restart samba (via the services), or with this command:

/etc/rc.d/init.d/smb restart

A slightly more in-depth example (I did this on a Slackware server); Modify your /etc/samba/smb.conf file to best reflect your environment, here is an example:

workgroup = MYNET
Security = user
server string = Slackware Server
log file = /var/log/samba.%m
max log size = 50
socket options = TCP_NODELAY
dns proxy = No

# Add a section like this if you want to provide access to a specific folder,
# If user access has already been added (see above), then this step isn't necessary
# for accessing your home directory...
comment = Roqetman's share on Barsoom
path = /usr/home/roqetman/
valid users = roqetman roqetgirl
public = no
writable = yes
printable = no
create mask = 0765

Next, you need to set up the encrypted password, type:

smbpasswd -a username

Finally, stop and start samba with these commands:

smbd stop
nmbd stop
smbd start
nmbd start

Now check on your windows box under "Network Neighborhood", or browse to \\machinename\username and you should now have a file server (which you can then map to).

Samba Browsing Tools

There is a handy tool called smbc (Text mode SMB network commander), and from nautillus on the Gnome desktop, you can type smb:// to browse the network and display the shares (you can click the icons to access) or type smb://servername/sharename for direct access.

© Roqet :: 2022-03-01 16:07:34