Set up Samba file server on Ubuntu 14.04.02 LTS

Monitor of my laptop doesn’t perform well that it makes me my eyes tired even watch in a short period. But the PC displays really well and it runs in a quite fast speed. So I also need to code on PC and run on server on laptop. Sama server comes out natually.

I follow the guides from

https://help.ubuntu.com/lts/serverguide/samba-fileprint-security.html

and

http://www.liberiangeek.net/2014/07/ubuntu-tips-create-samba-file-server-ubuntu-14-04/

and

https://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/StandAloneServer.html#id2574171

Like this:

sudo nano /etc/samba/smb.conf

In this file, we’ll want to add Samba global configuration directives block below.

[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = ubuntu
security = user
map to guest = bad user
name resolve order = bcast host
dns proxy = no

The configuration block above defines how security is managed, which server name to use to connect and the workgroup that’s assigned to the server.

When you’re done entering the global config block above save the file and exit.

  • Creating Samba Shares

Now that we’ve installed Samba and set it’s global configuration, let’s go and create the directory we’ll want to share with everyone.

sudo mkdir -p /home/nodeshare

After the directory is created, make sure to change the ownership of it to nobody. This allows everyone to have access to it. To do that, run the commands below.

cd /home
sudo chmod -R 0755 nodeshare
sudo chown -R nobody:nogroup nodeshare/

  • Enabling Samba Shares For Allaccess Directory

The next step now is to define the allaccess directory in Samba configuration file to enable all access via Samba. To do that, type the share block below to allow full access to everyone using Samba or SMB protocol.

[nodeshare]
path = /home/nodeshare
browsable = yes
writable = yes
guest ok = yes
read only = no

Now Samba configuration should should look like the block below. Samba global block and all access defined.

[global]
workgroup = TAMK
server string = Samba Server %v
netbios name = ubuntu
security = user
map to guest = bad user
name resolve order = bcast host
dns proxy = no
#============================ Share Definitions ==============================
[nodeshare]
path = /home/nodeshare
browsable =yes
writable = yes
guest ok = no
read only = no

Restart Samba by running the commands below.

sudo service smbd restart

Save the file and try to access the nodeshare share from a Windows client. To do that click the Run box and type \\ubuntu\nodeshare or \\ubuntu_ip\nodeshare

the folder can be accessed. But it indicates that there are no permissions to write.

I log in as ubuntu sudo user name and password and access the files and dirctories and change the ownership of it to nobody. But problem remains.

and I comment already the command in the samba config file:

valid users= %S

which disable the function of only ‘usrename’ can connect to \\server\username

But problems still.

At last I solve it set the path to

path = /home/username

or

path = /home/

Then the files and directories under home or my username can be read and written by my PC. The only directories which belong to default created like Documents and Downloads can be implemented. Those folders that are created by myself can not be written yet.

I doublt it is caused by the file access previlige problem.But sudo chmod and sudo chown list above should be implementable. But problem stays still.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s