Samba share on Ubuntu Server Host.

December 29th, 2013 by Andrea Matesi 31468 Views

I experimented with the manual creation of a samba share on an instance of Ubuntu Server. Here's the commands I used...

sudo su
useradd amatesi
smbpasswd -a amatesi
vi /etc/samba/smbusers <- insert the following: amatesi = "network username"

smbpasswd -a amatesi
addgroup samba-users
adduser amatesi samba-users

chown -R root:samba-users /var/samba-share
chmod -R 771 /var/samba-share

/etc/samba/smb.conf content:

comment = samba-share directory
path = /var/samba-share
public = yes
writable = yes
valid users = amatesi
create mask = 0771
directory mask = 0771
force user = amatesi
force group = samba-users

/etc/init.d/samba restart

One synonym for guest access is "public = yes".

To access the shared folder from Windows, "Start" -> "Run...":


And replace 192.168.x.x with your actual Ubuntu Server IP address sharing the folder.

To access the shared folder from a Linux GUI, type the following in Konqueror or Nautilus:


To access the shared folder from a Linux terminal or console:

smbclient -L SERVER-NAME

If the command above doesn't work, try the following command:

smbclient -L SERVER-NAME -I 192.168.x.x

...where SERVER-NAME = netbios name from /etc/samba/smb.conf and 192.168.x.x is the Ubuntu server hosting the files.

To delete a network user:

sudo smbpasswd -x system_username

To Enable SWAT.

edit the /etc/xinetd.d/swat file and make it similar to the following:

# SWAT is the Samba Web Administration Tool.
service swat
socket_type = stream
protocol = tcp
port = 901
wait = no
user = root
server = /usr/sbin/swat
#    only_from =
log_on_failure += USERID
disable = no

/etc/init.d/xinitd restart

Then restart the xinitd daemon


Posted in LINUX, System Administration | Comments Off on Samba share on Ubuntu Server Host.

Comments are closed.