Samba Shares Not Working

Discussion and Technical Support for general software applications and utilities including OS related issues.
FShtkh
Member
Member
Posts: 8
Joined: March 21st, 2011, 11:50 am

Samba Shares Not Working

Post by FShtkh »

Hi,

First post of a nearly newbie Linux user, so be gentle! Past experience is limited to an Ubuntu Studio install on an old laptop that I am about remove and building a picture frame based on DSL with an old laptop (all from instructions on the web). Sorry about the lengthy post below.

So I found this excellent website just as I was considering options to upgrade from a Buffalo Linksation to something more capable as a file serve and media server.

Being a cautions chap, I am testing it in a VMWare install under Win7 on my desktop before I buy hardware first. Within this VMware did an "easy install" of Ubuntu Server and then I started following the instructions. Completed to date:

-Server install
-OpenSSH install - Working
-VNC virtual desktop setup - Working
-Cron script to launch VNC onstartup - Working
-Synaptic Package Manager - Working
-Samba installed - Problem
-Webmin Installed - Working
-MythTV installed (but not fully configured as my USB DTV stick is a problem)

I skipped the temperature, spin down, NFS, KVM & Raid items as this is a VM but would do this on the final build.

The problem I have is that I cannot get Samba to let me access the shares from either Ubuntu Server, my Ubuntu Laptop, Win7 or WinXP . I have:

-created a test user , with the owner set to Testuser & not Root
-created a test user folder in the Home directory for that user
-created a share to that (with both 755 & 777 permissions on different occasions)
-added myself, Testuser and another user to the specified read/write users under Samba webmin set-up for the share
-added the above users to a group called "Users" and given the whole group read/write access
-added the above users to the group called "Samba" and given the whole group read/write access

I noted that under the Samba setup in Webmin in "Edit Users" only my user name and one called "Nobody" were listed, not the other users. Is this only people with control of the Smba setup, or should this also list the other users? In a desperate moment after trying all the above, I have now deleted the "Nobody" and still no change.

Actually accessing shares was the last thing I expected to be a problem, but is the most basic function that I do need to get working! I am fairly familiar with the user/group concept as the dumbed down system on my Linkstation uses this arrangement as well. The Ubuntu VM will happily login to Win7 and Linkstations shares BTW.

I should add that my build plan for the physical server was to have a system drive for the OS, and 3 drive software Raid set-up to store the data on. That may make configuring Samba easier, but I would like to nail this problem rather than buy the hardware an have an issue.

Any thoughts gratefully received, and again apologies for the long post, but I am trying to give the background!

Regards,

Frank
User avatar
pete66
Member
Member
Posts: 14
Joined: January 9th, 2011, 2:56 pm

Re: Samba Shares Not Working

Post by pete66 »

Great first post Frank and welcome to the forums. :thumbup:

Unless I missed it you've not mentioned what happens when you try and access the server via Samba. I know you said it doesn't work but can you be more specific? do you get an error message or can it simply not see anything?

Pete.
Case: Antec Three Hundred
Motherboard: Motherboard GA-P55A-UD4P.
Processor: Intel Core i5 750 Processor 2.66 GHz
Memory: Corsair 4GB
Hard Drives: Western Digital Caviar Black 2 TB for OS. 2 * 2TB SAMSUNG HD204UI for movies and music
FShtkh
Member
Member
Posts: 8
Joined: March 21st, 2011, 11:50 am

Re: Samba Shares Not Working

Post by FShtkh »

Doh! Apologies, so much information and I missed that bit!

Essentially I get stuck in a loop of boxes popping up trying to get me to login when accessing the share from Windows in Network Places or from map network drive.

On XP & Win7 I can see the server and the share, but not open the "folder", I get asked to login or a warning message saying I don't have permission to access etc. My Windows user is the same name and password as my Ubuntu main (root?) user, but I have also tried the "Testuser" login as well (as an alternative login, but I do not have the "Testuser" login configured on my windows machine, will try adding later).

If I use the VNC desktop interface on the Ubuntu server to navigate through "Places" to the share I have the same problem. (I don't have the server in front of me as I am at work (lunchtime posting ;-) ) but I beleive from memory it asks me to login, or flatly refuses. Will check when I get home and let you know. (similar on the Ubuntu Studio laptop).

I don't think I have a Workgroup issue, as I can happily see the server/share, just not open it.

Hope this clarifies the issue!

Regards,

Frank
User avatar
Ian
Moderator
Posts: 752
Joined: January 1st, 2011, 7:00 am

Re: Samba Shares Not Working

Post by Ian »

Hi Frank,

Another lunchtime poster here :lol:

Have you "converted" the ubuntu user to a samba user? They are not one and the same. I'll have to check which screen it is on but in Webmin somewhere under Users there is an option to "convert users to samba users". Run that, restart samba, and see if it makes a difference.
FShtkh
Member
Member
Posts: 8
Joined: March 21st, 2011, 11:50 am

Re: Samba Shares Not Working

Post by FShtkh »

Hmm, I thought I had. I don't have access right now to check. I thought I found a TAB in the settings to convert users (to UNIX users?)? is this what you mean?

I can't remeber exactly, but I though I asked it to auto synchronise the conversion.

I am beginning to think this may be the spectacularly simple thing I have missed. :oops:

Hard to tell till I can get home. Will let you know, thanks!

Regards,

Frank
User avatar
Ian
Moderator
Posts: 752
Joined: January 1st, 2011, 7:00 am

Re: Samba Shares Not Working

Post by Ian »

Frank,

OK, to double-check your settings go into Webmin and choose Samba Windows File Sharing under Servers . Then Edit Samba users and passwords then click on the user. Then set the New Password field and click Save. Then restart samba.

Also, using Putty please send me the permissions on the folder you're trying to share:

Code: Select all

ls -l FolderYouAreTryingToShare


Try also adding the following 3 lines to the [global] section of your samba config file. In Webmin go into Samba Windows File Sharing under Servers then Edit Config File. Scroll down to the section that reads:

Code: Select all

#======================= Global Settings =======================

[global]


And paste these 3 lines after the [global] tag:

Code: Select all

follow symlinks = yes
wide links = yes
unix extensions = no


Then restart Samba.

Thanks,

Ian.
FShtkh
Member
Member
Posts: 8
Joined: March 21st, 2011, 11:50 am

Re: Samba Shares Not Working

Post by FShtkh »

Hi Guys,

A step forward. Following Ian's advice, I went in and re-entered the password for each user, and now I had read access to the folder, I also added the lines to the global config.

When I tried to check the permissions on the folder, I did:

$ cd home/testuser

$ ls -l testfolder

and the result was:

total 0

I'm guessing that's not what you expected, and I am not the best at command line stuff.

From the VNC virtual desktop I did a left click and checked, the folder in question is owned by ROOT and only allows the ROOT group. I think this was because I was logged in as Franco, creating a folder in Testuser, so I had to sudo to do it. Guess I'm not quite as familiar with the results of such things!

Creating another folder in my Franco home folder, the leaving the owner as Franco and changing the group from Root to User has resulted in a working read write share accessible from my XP machine. Yay!

I'm guessing if I had created the folder as another group User, rather than as my main identity, it would not keep defaulting to Root?

Think I had a combination of problems which I seem to be working through. Indecently, Webmin seems to be auto-syncing the samba user list now as well.

Thanks for your help, now I just need to have a crack at all the other more complex stuff!

Regards,

Frank
thinmintaddict
Member
Member
Posts: 25
Joined: March 24th, 2011, 6:35 am

Re: Samba Shares Not Working

Post by thinmintaddict »

So here is the couple tips I could think of:

This is what Ian was referring to:
Linux Users and Samba Users are not the same. to make sure that you have samba users set up correctly you need to in Webmin:

1. "Convert UNIX Users to Samba Users."
2. Edit the Samba Users and give them a password. the password doesn't come with the user when you convert it.



So once your Samba Users are set up correctly you need to make sure that their corresponding Linux Users have access to the shared folder in your file system. e.g. if you have a "testuser" in samba, then "testuser" needs to have read and write access to the folder in the server's file system.

If you want anyone to be able to access the files you can just:

Code: Select all

sudo chmod -R 777 <path/to/shared/folder>


If you want just "testuser" to be able to write to the shared folder then you can:

Code: Select all

sudo chown -R testuser:users <path/to/shared/folder> 
and then

Code: Select all

sudo chmod -R 755 <path/to/shared/folder>



the "chown" command changes the ownership of the folder to "user:group." "ch[/code]mod" changes the permissions to the folder. 777 means that everyone read and write to it. 755 means that anyone can read from it, but only the user that owns it can write to it.
the -R flag tells it to apply the change recursively, so it will affect everything inside the folder as well.

It sounds like the second part is what you're still missing. because while Samba is telling you "yea, you're good" Ubuntu is saying "sorry man, only root is allowed to mess with this." That should fix it. If you want some more info on permissions or anything doesn't make sense, let me know.
User avatar
Ian
Moderator
Posts: 752
Joined: January 1st, 2011, 7:00 am

Re: Samba Shares Not Working

Post by Ian »

@thinmintaddict

The more posts of yours I read the more I realise that my guides are lacking in so many ways. You're adding a lot of work to my todo list. :roll: I might have to consider banning you from these forums :lol:

Just kidding, your input here is truly fantastic and I'm chuffed to bits you're taking the time to share your knowledge. Thank you :clap:

Ian.
FShtkh
Member
Member
Posts: 8
Joined: March 21st, 2011, 11:50 am

Re: Samba Shares Not Working

Post by FShtkh »

@thinmintaddict

Thanks for the comments, sorry about the delay in response! Been busy parenting and updating an old Dell laptop to Linux Mint (quite nice, not used it before and the laptop seems to cope).

Thanks for the command line info, I think I managed to figure out how to change all the things you note via my VNC virtual desktop and Webmin, but it would be more direct the way you do it (I'm primarily a windows user, and command line is a different world to me!).

I'll probably use your method when I complete the final hardware build, as opposed to my Vmware test. I won't need to add many shares or users either. What you have written does make sense to me BTW.

@Ian

Its a great guide, and your helpful followers fill in the gaps! I would not have tried this route without your guide, I would probably have tired Amahi, but I don't like the need for the server to become your DNS router (when I have a perfectly good hardware box ADSL modem suitable for a home network); the need for an Amahi server to always be connected to the internet or that they are starting to charge for some items.

Thanks again to both of you

Frank
Post Reply