LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 04-02-2008, 04:01 AM   #1
chuchsn
LQ Newbie
 
Registered: Apr 2008
Posts: 8

Rep: Reputation: 0
Share Linux Folder to Windows


Hi,

I have 2 pc's running, one with linux (ubuntu 7.10), and one with xp prof. I'm already able to access my windows shares, but i don't get it to work to share files/folders on linux and access it with windows.

that's what i've done. (i did it with the gui, not the console way)
- i made a folder under media called "shares" (as user root)
- rightclick, "Share Folder"
- Share through: Windows networks (SMB)
- Name: share
- unsigned Read only

then i tried to map it with windows
Tools -> Map Network Drive
Folder: \\IP\media\shares
Finish and now it requires a User name and a pw

lets say the linux machines name is "lin01"
and i have beside root a user called "veri"
what is the correct username?

in windows you would use lin01\veri, but this way doesnt worked, it drops back to the pw check immediately

edit: when i use just the username "veri", i trys to connect for a few seconds, but the it drops back too.

hope you can help me,
thanks

Last edited by chuchsn; 04-02-2008 at 04:08 AM.
 
Old 04-02-2008, 04:51 AM   #2
Absent Minded
Member
 
Registered: Nov 2007
Location: Washington State U.S.A.
Distribution: Debian testing
Posts: 74

Rep: Reputation: 21
Did you set up a SAMBA server?
 
Old 04-02-2008, 06:03 AM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
use smbpasswd to add a user/password in samba's /etc/samba/smbpasswd file, which functions similarly to the /etc/passwd file, but the uid is a Windows ID.

Also post the configuration for the share and how you created it. Is it a world writable public share?
Samba needs to map windows users to Linux users and map Linux permissions to windows permissions. If the directory you are sharing isn't owned by the user, then the "other" bits need to be set appropriately. For a globally writable share, create the directory just like the /tmp directory with the "sticky" bit set on the directory:
example:
Code:
sudo mkdir /srv/samba/public
chmod a=rwxt /srv/samba/public
If the share is set up as public, you won't need to enter a username and password. If this is a private share for the user, located on the server, you will need to add that user as a Linux user as well. Look at the default [Homes] or [Profiles] services for an example.

PS, also make sure that ports 139 & 445 are open on the Samba server. Make sure that the samba daemons (smbd & nmbd) are running.
To check:
sudo /sbin/chkconfig smb
sudo /sbin/chkconfig nmb

To list the runlevels they area run as:
Code:
sudo /sbin/chkconfig -l smb nmb
smb                       0:off  1:off  2:off  3:on   4:off  5:on   6:off
nmb                       0:off  1:off  2:off  3:on   4:off  5:on   6:off
note: Sorry, but I am not certain whether or not Ubuntu uses chkconfig to list and control services.

Last edited by jschiwal; 04-02-2008 at 06:10 AM.
 
Old 04-02-2008, 08:11 AM   #4
chuchsn
LQ Newbie
 
Registered: Apr 2008
Posts: 8

Original Poster
Rep: Reputation: 0
thanks for reply

@Absent_Minded, i have just installed samba with Synaptic, that was enough to access the shared folder which was on the windows machine, so i thought it should work the opposite way too.

@jschiwal, How can I configure the shared folder?
I did just what i wrote, created a folder under /media
and then rightclicked on it, and selected the option "Share Folder".

the folder should be accessable by everyone, so no specific user. so it shouldn't be necessary to add a user to samba. anyway, i tried to look up the /etc/samba/smbpasswd, but there was no smbpasswd file in the folder (neither a hidden file ), just smb.conf, dhcp.conf and gdbcommands.

i also checked if the daemons were running, as you said, but i got the following error:
Code:
sudo: /sbin/chkconfig: command not found
hope you can help me get this to work today

edit: have installed "swat" (webbased admin tool for samba). there I can lookup the status, and smbd/nmbd seem to be both running

Last edited by chuchsn; 04-02-2008 at 11:14 AM.
 
Old 04-03-2008, 06:23 AM   #5
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Some flavors of Linux don't have the chkconfig command.

The /media directory isn't a good place to create a directory. It is used for auto-mounted directories that are created and removed on the fly. I would recommend /src/samba/public. You could name it something else than "public" of course.
Code:
sudo mkdir -p /srv/samba/public

sudo chmod a=rwxt /srv/samba
sudo chmod a=rwxt /srv/samba/public
The sticky bit prevents one user from deleting the files of another user.
The share definition need not be complicated.
Code:
[public]
        path = /srv/samba/public
        guest ok = Yes
        read only = No
Earlier in the [global] section is this definition:
Code:
        map to guest = Bad User
It is probably the same on yours. This will map an unknown user to the "guest" user. However, if you use the smbpasswd program to create users with the same password as in windows, then since the user is known, the file will be owned by that user instead of being owned by "nobody".

The /etc/samba/smbpasswd file probably doesn't exist because you haven't used the smbpasswd program yet.

See if you have a samba-doc package available. It includes some books that can help you understand and configure Samba servers. "Samba 3 by Example" and "Samba 3 Howto & Reference Guide". These are the same books that are available in the bookstore.

Last edited by jschiwal; 04-03-2008 at 06:25 AM.
 
Old 04-04-2008, 08:24 AM   #6
chuchsn
LQ Newbie
 
Registered: Apr 2008
Posts: 8

Original Poster
Rep: Reputation: 0
finally, i got it to work

actually it was my own fault that i wasn't able to connect, i used the full path on windows, and not the share name
ex. \\192.168.1.230\media\shares, and not only \\192.168.1.230\shares

thanks everyone for helping me
 
  


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
how to accessing windows share folder from Linux Machine imughal Linux - Newbie 1 02-29-2008 01:49 AM
share folder on Linux to Windows ashley75 Linux - General 3 06-10-2005 04:12 PM
writing windows share folder boToo Linux - Newbie 2 06-09-2005 10:30 AM
samba mount to windows share folder lewkh Red Hat 1 03-01-2005 03:31 PM
How to share the same folder under VFAT using Fedora and Windows? lnthai2002 Linux - Newbie 2 01-29-2005 11:00 PM


All times are GMT -5. The time now is 06:33 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