LinuxQuestions.org
Register a domain and help support LQ
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 08-04-2003, 12:29 PM   #1
fettouhi
Member
 
Registered: Jun 2003
Distribution: Arch Linux i686
Posts: 67

Rep: Reputation: 15
Setting up Samba


I've been trying to set up a samba server on my RH 9.0 box (dualboot with Win XP Pro) but with no luck so far. first thing I did was reconfigure /etc/samba/sbm.conf and this is the result

[global]
netbios name = SERVERNAME
server string = "Samba Server"
workgroup = WORKGROUP
security = user
log file = /var/log/samba.log
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
encrypt passwords = yes
wins support = yes

[<username>]
path = /home/<username>
guest ok = yes
valid users = <username>
writeable = yes

I encrypt the samba password for the user with command

smbpasswd -a <username>

I start the samba server through a modification of xinetd, i.e. (I add the following to xinetd)

service netbios-ns
{
socket_type = dgram
protocol = udp
wait = yes
user = root
group = root
server = /bin/nmbd
}

service netbios-ssn
{
socket_type = stream
protocol = tcp
wait = no
user = root
group = root
server = /bin/smbd
}

then I restart RH 9.0 after that I log into win xp and map the drive and the massage that \\server\<username> cannot be found.

What am I doing wrong, it's driving me crazy the least. I used the Unofficial guide to samba from the www.samba.org page. What am I missing is it the fact my security level in linux is to high and doesn't allow the connection?

Kind Regards

André

 
Old 08-04-2003, 12:36 PM   #2
lappen
Member
 
Registered: Aug 2003
Location: Sweden
Distribution: Slackware 9.1 / Gentoo
Posts: 83

Rep: Reputation: 15
Read this book instead, doesn't take to long and I promise you will have a working samba setup

http://www.oreilly.com/catalog/samba/chapter/book/
 
Old 08-04-2003, 12:45 PM   #3
TrashCanMan
Member
 
Registered: Jul 2003
Location: Midlands, UK
Distribution: Slackware 10, Mandrake 9.2, Knoppix, Win XP
Posts: 62

Rep: Reputation: 15
Can you ping the server from the host and vice versa?

In other words, make sure your NICs are set up correctly and your network is running before you even think about Samba.
 
Old 08-04-2003, 01:40 PM   #4
fettouhi
Member
 
Registered: Jun 2003
Distribution: Arch Linux i686
Posts: 67

Original Poster
Rep: Reputation: 15
Thanks for the link and the swift replies. I did what it said on the link side and I tested the Samba server with

smbclient -U% -L localhost

and it found it, now pinged it under linux also and it found of course but under windows it can find the server. I can't figure what is wrong, is it linux that doesn't allow the incoming connection?

Regards

André Fettouhi
 
Old 08-04-2003, 02:14 PM   #5
jdruin
Member
 
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313

Rep: Reputation: 30
Redhat 9 firewall blocks Samba by default IF you have the firewall running. Not sure if you have a firewall running at all but its worth checking.

If needed:

One way to allow Samba to get through is to use Lokkit.

/usr/sbin/lokkit on mine

On the lokkit interface under 'other ports', allow the following

137:UDP 138:UDP 139:TCP

I have seen in some posts that 445:TCP also needs to be allowed for some versions of Samba but I did not allow 445 on mine.

I think the 137 and 138 ports are used for NMBD and the port 139 is for SMBD.
 
Old 08-04-2003, 02:22 PM   #6
jdruin
Member
 
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313

Rep: Reputation: 30
Another thing that might make configuration easier is to use ntsysv to set up xinetd if you had not already thought of it.

If needed:

/usr/sbin/ntsysv on my machine

You can just check off the "smb" box and it will auto start both smbd and nmbd once you restart xinetd.

To restart xinetd:

/etc/rc.d/init.d/xinetd restart
 
Old 08-04-2003, 04:57 PM   #7
fettouhi
Member
 
Registered: Jun 2003
Distribution: Arch Linux i686
Posts: 67

Original Poster
Rep: Reputation: 15
Again many thanks for all your suggestions I've tried them but the result is still the same. Win XP can't connect to the server when Itry to map the drive. Pinging fails also still, I've shut the firewall of in RH 9.0 and still no change that means something is configured wrong. My internet connection is a DHCP connection so I get all the info from an external server except the DNS those I had to type in RH but und Win XP doesn't need them. Those anyone have an idea.

Kind Regards

André Fettouhi
 
Old 08-04-2003, 05:06 PM   #8
TrashCanMan
Member
 
Registered: Jul 2003
Location: Midlands, UK
Distribution: Slackware 10, Mandrake 9.2, Knoppix, Win XP
Posts: 62

Rep: Reputation: 15
If pinging fails, then it's not Samba. It's something else.

Concentrate on getting your pings through - it's what fixed a similar problem for me. My firewall was blocking the connection between my masqed network and the firewall PC. If RedHat uses something like Shorewall (ie like in Mandrake), you can turn it off but it still can get in the way. Check your NICs are configured properly. You can turn off Samba all together and you should still be able to ping each machine in the network, which will save you messing about with samba when that's not the problem.

Good Luck
 
Old 08-05-2003, 12:42 AM   #9
fettouhi
Member
 
Registered: Jun 2003
Distribution: Arch Linux i686
Posts: 67

Original Poster
Rep: Reputation: 15
How I check if my NICs are configured properly?

Regards

André Fettouhi
 
Old 08-05-2003, 01:55 AM   #10
TrashCanMan
Member
 
Registered: Jul 2003
Location: Midlands, UK
Distribution: Slackware 10, Mandrake 9.2, Knoppix, Win XP
Posts: 62

Rep: Reputation: 15
I know this might sound dumb - but is your network up when you use XP? Snafu'd cables are a real common problem (at least in my house, the missus keeps vacuum cleaning them )

have you run netconf or netconfig from a console (as root)? I have Mandrake 9.1, and the GUI setup wouldn't configure my cards properly so I had to resort to the good old fashioned console commands.

Are you using DHCP or static IP address assignment? For small networks (and noobs like me) I found DHCP to be a pain in the butt, and if you have only three or four PCs it's no real trouble to remember (or write down) the static IP of each machine. It really is simpler. Make sure all your machines are using the same protocol.

Happy Tinkering,

Matt
 
Old 08-05-2003, 02:24 AM   #11
levian
LQ Newbie
 
Registered: Aug 2003
Location: kadin, jkt
Distribution: Dolphin,Shrike,98
Posts: 20

Rep: Reputation: 0
From your first post i perceived that you tried to see your linux directories using samba from your win xp, and that, infact, they both reside on the same machine. Am i right? Im sorry if im wrong, but just in case if its true,...as far as i know windows can't read a unix file system directly.

Kind Regards

levian
 
Old 08-05-2003, 04:16 AM   #12
TrashCanMan
Member
 
Registered: Jul 2003
Location: Midlands, UK
Distribution: Slackware 10, Mandrake 9.2, Knoppix, Win XP
Posts: 62

Rep: Reputation: 15
Levian - That's what Samba does. It allows Windows and Linux to network, share files and folders, even printers. I can't believe how cool it is.

fettouhi - I've just had a thought. I think you might be running two different protocols. if your red hat protocol was DHCP, surely you wouldn't have to provide it with the DNS addresses - DHCP does that automatically, doesn't it? to use DHCP protocols on my mandrake machine, I have to run netconfig *and not specify my IP address*. If I want Static IP addresses, then I enter them in netconfig. Can't tell you about RedHat, tho I'm afraid.
 
Old 08-05-2003, 06:11 AM   #13
fettouhi
Member
 
Registered: Jun 2003
Distribution: Arch Linux i686
Posts: 67

Original Poster
Rep: Reputation: 15
Again many thanks. But I am bit confused now, so let me ask this simple question can I with samba share files between my linux partion and windows on the same machine or does samba only work on external machines that log in to a linux computer. I am running the same protocol on both partitions which is DHCP. This samba thing is giving me a headache.

Kind Regards

André Fettouhi

 
Old 08-05-2003, 06:17 AM   #14
TrashCanMan
Member
 
Registered: Jul 2003
Location: Midlands, UK
Distribution: Slackware 10, Mandrake 9.2, Knoppix, Win XP
Posts: 62

Rep: Reputation: 15
Righty ho.

To get at your files in windows from the your RedHat computer(it is dual booting, right?), you should just be able to mount the partition, and hey presto! you have access to the files on your windows partition.

You could then allow other users on other machines to access this windows partition through Samba.

Is that any help? sorry to confuse you.

Last edited by TrashCanMan; 08-05-2003 at 06:21 AM.
 
Old 08-05-2003, 07:43 AM   #15
jdruin
Member
 
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313

Rep: Reputation: 30
Hey

Samba is used to provide access to some folder (your choice) on your Linux box. The folder is shared on a network between computers which are running at the same time. The type of network is windows netbios which speaks Server Message Block (SMB). Windows 'sees' other windows boxes and samba servers using this protocol in its network neighborhood if these machine are part of the same workgroup. This book mentioned earlier by lappen really is great on explaining all this in the first few chapters

http://www.oreilly.com/catalog/samba/chapter/book/

All of this means that TrashCanMan is correct. You cannot use Samba to get at the WinXP on the RH harddrive because only one partition could be booted at once. But other Win boxes on the network could 'see' a correctly configured samba partition IF the RH box was booted. Also, you could mount the WinXP partition to the RH OS by using:

mount -t NTFS /dev/hdb1 /mnt/windows

This assumes you have NTFS as the file system on the XP partittion and the RH box 'sees' the windows partition as hdb1. Also, you may need to create the /mnt/windows directory. RH does not have it by default but other Linuxes do. You dont have to call it 'windows'. It just seems convienent.
 
  


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
Setting up Samba under 5.0.4 Linux31 Ubuntu 2 07-03-2005 11:37 PM
Help setting up Samba... CaptainRegular Linux - Networking 2 04-05-2005 07:03 AM
Setting up Samba kicken Linux - Newbie 3 06-07-2004 06:08 PM
setting up samba true_atlantis Linux - Newbie 1 05-28-2004 06:53 AM
Setting up Samba Spyder_Snyper Linux - Networking 2 01-24-2004 09:23 PM


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