LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Connectiong a Linux to a Windows XP computer using Samba (https://www.linuxquestions.org/questions/linux-newbie-8/connectiong-a-linux-to-a-windows-xp-computer-using-samba-371320/)

Dolphin2005 10-09-2005 05:08 PM

Connectiong a Linux to a Windows XP computer using Samba
 
Hi,

I am new to Linux and I just managed to install it recently. I have another computer running Windows XP and I wanted to be able to share folders. Both computers connect successfully to the Internet through a router. I have created a workgroup called "Mshome" and I can see the Linux computer in my Windows XP computer under "My Network Places" but I am unable to see its contents. I tried pinging the Windows XP computer from the Linux computer and it was unsuccessful. I also pinged the router from the LInux and it was successful as well as pinging itself. Pinging from the Windows XP computer to the Linux and the router were all successful.

I have included the contents smb.conf if that helps to determine what I have done wrong:

# Global parameters
[global]
workgroup = MSHOME
netbios name = ERITREA
server string = Samba Server
security = SHARE
encrypt passwords = No
password server = None
passwd program = /usr/bin/passwd %u
passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*
unix password sync = Yes
log file = /var/log/samba/%m.log
max log size = 50
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
local master = No
dns proxy = No
wins proxy = Yes
wins support = Yes
idmap uid = 16777216-33554431
idmap gid = 16777216-33554431
comment = Root's Account on the Linux Machine
path = /
read only = No
cups options = raw

[homes]
comment = Home Directories
browseable = No

[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No

[tmp]
comment = Temporary file space
path = /tmp
guest ok = Yes

[Root Directory]
comment = Hanna's Account on the Linux Machine
path = /home

Any help would be greatly appreciated.

Thanks.

felixc 10-09-2005 05:23 PM

Try adding browseable = yes to the things you want to share. That's about the only thing I can think of off the top of my head, not knowing much about Samba. Regards,

-Felix

sundialsvcs 10-09-2005 08:17 PM

The Samba web-site has a lot of how-tos about diagnosing these issues.

The statement that "you could not ping it, but you could see it" implies only that the Linux computer is not responding to "ping" requests. Unusual but possible. If the Windows box can see the presence of the Samba machine, then you know that the Samba machine is on the network, even if it doesn't answer "ping."

You'll probably find that Samba has created a log-entry in /var/log which describes what it has seen .. and has done .. when you tried to browse it. These clues should enable you to diagnose the problem further.

The Samba web-site should be the best possible source of clues at this point . . . or the very good O'Reilley books...

ScooterB 10-10-2005 08:40 AM

I find there are usually a couple of reasons for this type of occurrence, but we'll get to those in a moment. Part of your problem might actually be resolved by finding out why you can't ping the box. Granted, if in the firewall you have icmp requests to be dropped that would attribute to that problem. I would check this out and resolve it for no other reason than for the testing. Then if you want to turn icmp requests off, do so.

Now, on to working with Samba. This is by far one of the greatest things they ever invented. I work in a commercial environment and use Samba as a file server for our company's data. Works great. Now some things to look at:

1) Make sure that you actually create a share for the person to access. This might be a file called "test" for now. Then actually give that user permission to access this file. And by that I mean on the Linux side of it. If you create a directory and don't actually address the Linux permissions, they won't ever get to it. One thing to think about here is that you have in fact actually added the new user to the Linux box running Samba. If you don't do this, they won't have access.

2) Verify that Samba is actually running. At the command prompt type "ps -ef | grep smb". This should come back with several instances of the smbd daemon running. Now type "ps -ef | grep nmb". This is the other half of Samba. If they are both up and going, then that is one less area to mess with.

3) One of the areas about working with Samba and Winblows is that when samba is running it wants to be in charge. This goes against everything mr gates does but it makes it a pain in the @#?!. Sometimes when you add the samba box to a network, it can take up to ninety minutes for a machine to be able to see and access it. This is in the samba docs online by the way. It has to do with being a domain master controller and establishing that it is in charge. It has to have submission from the winblows box, so on and so forth.... The point is, the first time you put the samba box out there, don't expect to be able to just jump right on it. Go grab lunch or something and let them duke it out for a while. When you get back, you should be able to log on.

Check on each of these and then repost if you are still having problems.

NoStop 10-10-2005 11:59 AM

ScooterB,

Since you've obviously have alot of experience administering a samba server, I hope you don't mind if I ask you some questions. I'm not trying to hijack this thread, and probably your answers will be valueable to the thread itself?

Is it possible to create a new share, open to a different group of users, that still points to the same mount point as another existing share? I'm trying to find a way to give access to external USB2 drives from a media server I setup for a friend, so that one user can access the drive with rw permission and another user can access the same drive with only r permission. Or am I looking at this incorrectly and it's possible just to do this on an individual user basis?

The problem with these mounts to external drives is that they are owned by either root (if the drive is formatted NTFS, and of course is inherently set to ro) or the user originally logged on to the box when the USB drive was plugged in. So I'm using a forced user on the samba side to get access to the drive. On the other hand, I still want to control what individual users can do with the drives.

Thanks in advance.

Cheers.

ScooterB 10-10-2005 12:23 PM

I believe that will have to be a question for experimentation. I have never tried that, but I would assume as long as the external drives are configured to mount at boot, and the shares that exist on those drives are properly mapped in samba it might work. You would have to play with the file permissions on those files to be sure. Now, you know what they say about assuming anything so I could be way off here, but it would make sense from just the initial thought.

Dolphin2005 10-11-2005 12:40 PM

Hi.
I followed your advice and I can now ping from my Linuc to the Windows successfully - I had to switch off the the Firewall on the Windows machine.
I still cannot access Samba from my Windows XP even though I can see it in "My Network Places". I have checked the permissions and they are fine. I have also checked whether Samba is running and it is.. I have seen on some help pages about configuring WINS. I know that in smb.conf i have to choose whether Samba is a WINS client or a server and I jhave opted for it to be a Samba client (not sure why though). I am also not sure whether I am meant to configure anything on my Windows XP (becasue I have not done anything on the WIndows XP computer!). The error message I get when I click on the Samba Server on the Windows XP is "\\Lily is not accessible..........The network path was not found".
The smb.conf file now is as follows:
# Global parameters
[global]
workgroup = MSHOME
netbios name = LILY
server string = Samba Server
password server = None
passwd program = /usr/bin/passwd %u
passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*
unix password sync = Yes
log file = /var/log/samba/smbd.log
max log size = 50
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
local master = No
dns proxy = No
wins server = w.x.y.z
idmap uid = 16777216-33554431
idmap gid = 16777216-33554431
cups options = raw

[homes]
comment = Home Directories
read only = No

[tmp]
comment = Temporary file space
path = /tmp
read only = No
guest ok = Yes

[hannadir]
comment = Hanna's Service
path = /usr/somewhere/private
valid users = hanna
read only = No

[public]
path = /usr/somewhere/else/public
read only = No
guest only = Yes
guest ok = Yes

[myshare]
comment = Mariam's and Lily's Stuff
path = /usr/somewhere/shared
valid users = hanna, lily, root
read only = No
create mask = 0765
printable = Yes

[Root Directory]
comment = Root's Account on the Linux Machine
path = /home
valid users = root
read only = No

Any advice would be great. I just do not know what else to try.

Thanks

ScooterB 10-11-2005 01:15 PM

Good. You're getting somewhere now. If I understand you correctly, there is no "outside" access (i.e. from internet, etc) with this so to start go into your smb.conf file and comment out everything that has to do with the password authentication. Try that and see if you can connect. If you can, then it will be with the authentication that is taking place. It won't hurt to do this when getting it up and running. You'll just want to figure it out later.

One thing to check on here. Have you added the users via smbpasswd? This enables you to set up the users in samba and have their passwords stored. You should be using the same passwords that they use in Windows. If they don't have them then you can add them and then make the samba the same.

There is a really good admin program called webmin that can assist you with administering many Linux programs. You might check it out. Check on this and repost.

Dolphin2005 10-11-2005 03:25 PM

Hi,
I followed youir advice and it is working. Finally!!!
Thanks a lot for all your help. I would never have figured it out by myself. I will probably be back with another problem.
Thanks again.

ScooterB 10-11-2005 03:42 PM

Great!!! Just so you'll know, O'Reilly makes a great book on Samba which gives you entirely too much information but is a great reference. If you can find a way, you should get it. Good luck and have fun!!!


All times are GMT -5. The time now is 04:32 PM.