LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 01-20-2012, 11:57 AM   #1
chrisgreg
LQ Newbie
 
Registered: Jan 2012
Posts: 17

Rep: Reputation: Disabled
Why does Samba Server only work with default "homes" directory?


Hi All

I have been trying to set up a samba server. I have got the server to work fine with the default homes directory, but I'd like to be able to select just one folder to share, videos for example. However, whenever I remove the [homes] directory from the configuration file I get the message

Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.4.7]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME

I am using the command

smbclient //<hostname>/<sharename> -U <username>

My .conf file is as follows

[global]

workgroup = WORKGROUP
server string = %h server (Samba, Ubuntu)l
wins support = no
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
panic action = /usr/share/samba/panic-action %d

security = user
username map = /etc/samba/smbusers

encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = no
unix password sync = no
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

pam password change = no

map to guest = bad user


[Videos]
comment = Videos
path = /home/chris/Videos
read only = No
guest ok = Yes
public = Yes
browseable = Yes
create mask = 0666
directory mask = 0777

[homes]
comment = Home Directories
browseable = yes
read only = no
create mask = 0777
directory mask = 0777

valid users = chris

I have filled this in as best I can from searching through the forums, but it seems that other people seem to be able to remove the [homes] directory without a problem.

Am I being a complete idiot or is there something else wrong?

Any help would be really appreciated.
 
Old 01-20-2012, 01:07 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,790

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
@ Reply

Hi chrisgreg,

Welcome to LQ!!!

Few questions for you:

1. Does this work when you have [homes] enabled. Are you able to get into videos directory?
2. Permissions set on /home/chris/Videos
3.
Code:
map to guest = bad user
don't know but does not appears right to me. This one should be commented out I guess.
4. With which user account you are trying to access [Videos] share when [homes] is removed?
 
Old 01-20-2012, 03:28 PM   #3
chrisgreg
LQ Newbie
 
Registered: Jan 2012
Posts: 17

Original Poster
Rep: Reputation: Disabled
Thanks for your response

Hi, thank you for your response

When I have homes enabled I can view everything from local machine through terminal, and I can access everything from a windows 7 laptop and an Ubuntu laptop. I have mounted an external usb HDD into the homes directory which I can also access. The problem is as soon as I disable [homes] I then cant connect to smb, not even from local machine. On local terminal I get this

Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.4.7]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME

I can remove the map to guest = bad user bit, that was just there when I installed the package.

I am using the same user for everything to keep it simple.

It's not just the videos share, it is anything that isn't [homes], I have tried various different shares. I even tried just creating one with the path /home/chris and that didn't work either. As soon as I comment out [homes] it wont connect
 
Old 01-20-2012, 03:36 PM   #4
chrisgreg
LQ Newbie
 
Registered: Jan 2012
Posts: 17

Original Poster
Rep: Reputation: Disabled
The permissions are
owner (me) - create and delete folder
group - access folders
others - access folders
 
Old 01-20-2012, 03:43 PM   #5
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,790

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
@ Reply

Just now noticed that your share path for [Videos] is: path = /home/chris/Videos

It appears to me that as soon as you disable [homes] it prevent any thing to be seen under /home.

Is it possible for you to copy: /home/chris/Videos to / and set the same permissions as you have set up now.

Edit [Videos] section to reflect the new path.

Restart smb and nmb services and then give it a try.
 
Old 01-21-2012, 02:55 PM   #6
chrisgreg
LQ Newbie
 
Registered: Jan 2012
Posts: 17

Original Poster
Rep: Reputation: Disabled
Why does Samba Server only work with default "homes" directory?

Hi

I followed your advice, created /Videos and used this as the path for [Videos], as soon as I disable [homes] it won't connect regardless of the new path. Have I missed something obvious? Also when I have [Videos] and [homes] enabled it won't show anything other than the contents of [home]. I tested this by creating another diretory /sambatestshare and created [sambatestshare] in smb. I couldn't see this dir either
 
Old 01-21-2012, 03:27 PM   #7
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,790

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
@ Reply

Ok. Make a copy of your existing smb.conf file and then edit it as mentioned in this tutorial and see if that works:

http://ubuntuforums.org/showthread.php?t=202605
 
Old 01-24-2012, 12:43 PM   #8
chrisgreg
LQ Newbie
 
Registered: Jan 2012
Posts: 17

Original Poster
Rep: Reputation: Disabled
Hi

I have followed this guide and have used the configuration file, but still the same thing happens. If I specify a file path other than [homes] I get the message NT_STATUS_BAD_NETWORK_NAME. This is very frustrating, is it possible to view the log files for Samba?
 
Old 01-24-2012, 01:38 PM   #9
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,790

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
@ Reply

Alright. I have tested the following config on my Ubuntu 11.04 and it is working fine. I am able to browse to the folder and am able to create files and folders:

Code:
[global]
    ; General server settings
    netbios name = SAMBA-SERVER
    server string = This is my samba server
    workgroup = SAMBA
    announce version = 5.0
    socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192

    passdb backend = tdbsam
    security = user
    null passwords = false
    username map = /etc/samba/smbusers
    name resolve order = hosts wins bcast

    ;wins support = yes

    syslog = 1
    syslog only = yes

[test]
    path = /test
    browseable = yes
    read only = no
    guest ok = no
    create mask = 0644
    directory mask = 0755
    force user = testing
;    force group = YOUR_USERGROUP
Things that I checked are:

1. My firewall setting that is whether it is allowing connection for samba or not.
2. User account is added to smbusers. Did it via smbpasswd -a
3. Services are running both smbd and nmbd.

As you can see I do not have [homes] configured but still it works for me on my Ubuntu system.
 
Old 01-24-2012, 04:40 PM   #10
chrisgreg
LQ Newbie
 
Registered: Jan 2012
Posts: 17

Original Poster
Rep: Reputation: Disabled
brilliant that seems to work fine, I've set up my own directories etc and it all seems to work. Thanks very much for you help, I still don't understand what I was doing wrong but never mind.

Thanks Again
 
Old 01-24-2012, 04:52 PM   #11
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,790

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
@ Reply

You're welcome.

Please mark the thread as solved. It might be possible that there is something which we overlooked in your config file.

Enjoy linux!!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
changing default directory on "vsftp" server xone Linux - Software 4 01-07-2014 02:07 PM
Samba test share works, but homes returns with "network name cannot be found spiff28088 Linux - Server 8 05-01-2007 10:13 AM
Getting "Point'n'Print" to work on a samba server toombs Linux - Software 1 02-26-2007 09:18 PM
Samba: "homes" share, cannot create directories, can create files Herg Linux - Software 1 09-14-2006 08:48 AM
Authenticating to Samba share using "Active Directory Server" hlslaughter Linux - Software 36 07-23-2004 10:59 AM


All times are GMT -5. The time now is 10:39 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration