LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 08-08-2008, 11:56 PM   #1
oranyelik
LQ Newbie
 
Registered: Jul 2008
Posts: 11

Rep: Reputation: 1
Slackware 12.1 and Windows XP File sharing through Samba


Hi,

I need to configure a shared folder on my Slackware 12.1 box that will be accessible by any Windows XP machine on the network. I want to allow everyone read/write permission to my /var/www/htdocs folder on my slackware box without a username/password login, if possible.

I used SWAT to configure my smb.conf file. I got my Windows XP machine to view the slackware box, and the shared directory inside of it. However, when I tried to open that shared directory, I got an error:
Quote:
\\Host is not accessible. You might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permissions.

The network path was not found."
I tried using iptables and enabling both tcp and udp ports 137-139 and 445 (even though I read that slackware does not block any ports by default). The command iptables -t nat -A PREROUTING --in-interface eth0 -p tcp --dport 137 -j DNAT --to-destination 192.168.0.5 appeared to go through for both tcp and udp on each of the four ports that I mentioned, but after having done that I could only view the slackware box from my windows xp box, no longer open it.

I then tried manually editing my smb.conf file according to http://www.foogazi.com/2006/11/01/si...ackware-setup/ that guide, but that didn't change anything.

I ran the smbd 'in the front-end' (as was recommended) on my slackware box so I could see some action when I tried to do telnet from my XP box... but it ultimately failed and the XP machine said that it could not connect.


Please help me figure out how to get this file sharing configured! I've done searching through this forum and lots of google and cannot find a solution to my problem.

Here are my details:
- All of my network IPs are assigned by DHCP (but I don't think this will matter as long as I don't map a network drive and just go to 'View Workgroup Computers' to transfer files, which is fine)
- Workgroup name: Mshome
- Slackware 12.1 Box: Currently 192.168.0.4
- Trying to share /var/www/htdocs for access by any windows xp user on my home network
- Windows XP Box: Currently 192.168.0.5
- Windows XP box logs on using an account named 'Naro' with no password
- I have created a user on my slackware box called 'naro' with no password

Here is my smb.conf file:
Code:
    [global]
    workgroup = Mshome
    server string = Slackware 12.1 Server
    security = user
    load printers = yes
    log file = /var/log/samba.%m
    max log size = 50
    socket options = TCP_NODELAY

    [home]
    comment = Home Directory
    path = /var/www/htdocs/
    valid users = naro
    writable = yes
I've tried adding 192.168.0.5 through host allow... no luck.
 
Old 08-09-2008, 01:23 AM   #2
disturbed1
Senior Member
 
Registered: Mar 2005
Location: USA
Distribution: Slackware
Posts: 1,133
Blog Entries: 6

Rep: Reputation: 223Reputation: 223Reputation: 223
comment = Home Directory
path = /var/www/htdocs/
valid users = naro
writable = yes

If you want to have guest access, you shouldn't define the valid user as naro This would make the only user allowable to login as naro. Defeats your quest of not having to use a login.

Maybe -
Code:
[$SHARE]
        comment = $COMMENT
        path = /$PATH
        force user = $USER WITH READ/WRITE ACCESS
        read only = No
        create mask = 0777
        directory mask = 0777
        inherit permissions = Yes
        inherit owner = Yes
        guest only = Yes
        guest ok = Yes
        guest account = $USER WITH READ/WRITE ACCESS
$WHATEVER is the variable that needs to be set by you. Make sure the user has read/write access the shared drive in question and is a valid samba/unix user.
 
Old 08-09-2008, 11:28 AM   #3
oranyelik
LQ Newbie
 
Registered: Jul 2008
Posts: 11

Original Poster
Rep: Reputation: 1
I'll have to give your configuration suggestion a try. I'll report back later tonight whether or not my problem is fixed.

$USER would be the account that I created on my Linux box? In this case, it'd be the user 'naro'...? I think that I used the command 'adduser naro' to add the account that I want my XP boxes to use, and entered no password for it. I didn't add it any group other than users.

Perhaps the user 'naro' does not have access to my /var/www/htdocs file...? Would this cause the problem that I'm having? I can find out using an ls -l in my /, /var, and /var/www folder, right? All I need to do is chmod -777 -R on my /var folder? I would imagine that's really insecure (because if possible, I wouldn't want Windows XP users to have full control in any folder except the htdocs file). I'd like to avoid this method if possible, but if it's the only thing that will work I'll do it (because I'm not concerned about security, just about accidents!)

And by saying Guest Only = Yes, that will allow anyone to use the share without having to log in, right? And anyone who logs in is going to be forced into this guest account, no matter what they log in as on any Windows box?

Thanks a lot!
 
Old 08-09-2008, 06:46 PM   #4
oranyelik
LQ Newbie
 
Registered: Jul 2008
Posts: 11

Original Poster
Rep: Reputation: 1
I've read a little bit of research about sercurity=share... should I use that parameter in my [global] section?

Also, should I write the bolded text 'with read/write access', or are those just comments that you added in there? Sorry I don't know my linux very well and I'm thinking that those could be parameters?
 
Old 08-09-2008, 09:07 PM   #5
disturbed1
Senior Member
 
Registered: Mar 2005
Location: USA
Distribution: Slackware
Posts: 1,133
Blog Entries: 6

Rep: Reputation: 223Reputation: 223Reputation: 223
They're just comments. Meaning that the user that you define here should have read and write access to the folder your wanting to share.

Guest only means samba will not ask for a username/pass.

Guest user = maps who ever logs into the samba share as that user.

$USER has to be both a valid unix and samba user. $USER also needs to have read/write access for the shared drive.

If you're concerned about accidents, then perhaps not everyone should be trusted with rw access to a folder


I would re-read the samba docs again. They cover everything (and then some ) that you want to do. man samba. This gives the names of the different programs. Then you can man each one of those program.

Doing a google search gives these results http://www.google.com/search?hl=en&s...access&spell=1
 
Old 08-10-2008, 02:46 AM   #6
silverbird
LQ Newbie
 
Registered: Jun 2008
Location: Philippines
Distribution: Slackware
Posts: 24

Rep: Reputation: 0
Yes I would try adding a samba user. (smbadduser)
 
Old 08-10-2008, 11:44 AM   #7
oranyelik
LQ Newbie
 
Registered: Jul 2008
Posts: 11

Original Poster
Rep: Reputation: 1
Alright, I've got it working. I took you suggestions here and combined them with a little bit of googling to get things working. Here is what I did to fix my problem, for anyone else who may view the thread in the future:

First, I made sure that my Linux user 'naro' could read/write the /var/www/htdocs folder... and that was successful. I must have already set the permission using chmod 777 /var/www/htdocs.

Second, I changed my smb.conf file to look like the following:
Code:
   [global]
    workgroup = Mshome
    server string = Slackware 12.1 Server
    security = user
    load printers = yes
    log file = /var/log/samba.%m
    max log size = 50
    socket options = TCP_NODELAY

    [share]
        comment = sw12_1 share
        path = /var/www/htdocs
        force user = naro
        read only = No
        create mask = 0777
        directory mask = 0777
        inherit permissions = Yes
        inherit owner = Yes
        guest only = Yes
        guest ok = Yes
        guest account = naro
I took disturbed's suggestion of not having 'valid users' as a parameter in my smb.conf file.

Finally, I had to add the Linux user 'naro' to my samba users by doing the command smbpasswd -a naro. I read from the man pages that the -a parameter simply adds the user (or is ignored if the user already exists). When it asked for a password I just pressed enter (effectively creating no password).

I am now able to log in from the Windows XP box I've been testing with (the one that logs in as Naro). I'll test it out on my other Windows XP boxes in a moment, but I'm hopeful that it will work.

Thanks a lot for the help everyone.
 
  


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
Samba, Problem file sharing with Windows Genestealer Linux - Networking 2 08-13-2007 03:55 AM
file sharing with windows other than samba bruse Linux - Networking 7 05-09-2005 06:54 AM
Samba and Windows XP file sharing rattiane Linux - Networking 1 03-23-2005 10:47 AM
samba file sharing windows partition ganja_guru Linux - Newbie 11 11-28-2004 10:46 AM
samba redhat-windows file sharing rigolo Linux - Networking 7 08-05-2003 09:47 AM


All times are GMT -5. The time now is 02:11 PM.

Main Menu
Advertisement
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