Jump to content

windows can't connect to linux via samba


arthurking
 Share

Recommended Posts

From a previous post in the General->Software forum:

 

"I've configured samba B4 when I was running 9.1, via swat and/or webmin. I preferred webmin.

Now I'm running 9.2, samba 2.2.8a and I can fully access winXP from 9.2.

But, even though I can see my 'Samba Server 2.2.8a' computer on my 'home' workgroup in network places, it says I don't have permission and to see my admin (me) when I try to connect. The login prompt doesn't come up.

This is a home (playing around with everything to see how it works) network, and one of the reasons for my upgrade to 9.2 was because of the exact opposite problem with samba 2.2.7a on 9.1. I had it working fine for a time, then I probably stuffed up something unknowingly and Linux couldn't access winXP ??

I must be overlooking some small detail and there's no firewall running on linux. When there was(guarddog) it was configured to allow everything from winXP box. Firewall on winXP is set to allow all ports & protocals from linux etc. Users were set with authentication, to map my windows users to my linux users (me & me), guest account on, etc."

 

I have done what I believe is everything, to get access to linux from windows, without success. I had a bit more of a read and tried to set winbind. Followed some instructions on that and still no luck.

 

iptables is not running, firewall disabled, tried to configure smb.conf with swat, with no luck :wall:

One thing I did notice though is that even though I had set winbind enum user(& group) = yes, in smb.conf manually (ie. not via SWAT), when I check the smb.conf file through swat, those two lines don't appear in the smb.conf file. When viewed via Gedit or vi they are there :unsure:

I also set winbind uid(& giud) = 10000-20000 and those two lines appear ok ??

My problem is trying to log into the samba shares from windows. Previously in my mdk9.1 incarnation of samba, if I trid to connect to linux from network neighborhood I was prompted for a password by windows. Now I only get the "I'm not authorized......" message.

A couple of days ago if I typed smbclient -L localhost , I would get a message saying port was closed(or something like that) no firewall or iptables etc. Having played around with samba a bit, now I see my shares, the two computers and all sorts of info.

I can ping Linux from the windows machine, just no can do on the samba browsing.

 

help!

Link to comment
Share on other sites

I had the exact same problem when I first installed 9.2. I tried everything to I could think of to try and get it so that my windows computers could access my linux server. What eventually worked for me was manually adding the required users to Samba. I used swat for this, but I am sure that you can do the same thing in webmin.

 

The strange thing is that I am certain that I did not have to do this with 9.1. I thought that if you did not specify users for Samba, it would default to the Linux users file. However, this does not seem to be true with 9.2 (or it may just be Samba 2.2.8a).

 

Anyway, try adding your users (userid, password) manually and see if that helps.

Link to comment
Share on other sites

Hi fuzzylizard,

I know what you're saying, I remember 'mapping' my windows user to a UNIX user and when I tried to log on from windows I typed my password(ie. linux user) into a login prompt and got access.

Now I don't get the login box, just a message saying

------------------------------------------------------------------------------------------------

"....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 account is not authorized to log in from this station"

------------------------------------------------------------------------------------------------

I have tried everything I can think of to set permissions for my windows box to access samba, I am the administrator, it should be authorized to log in from this station (I have set it in 'hosts allow') etc. I think I mentioned I can ping from win to linux box just no access to samba.

I set my user as

arthur = arthur pcguest admin root (I tried all combinations etc, no luck)

I'm not a hacker and all that stuff, but I tried to telnet from windows to linux but couldn't figure that out too. I've never needed to do it B4, so now I'm going to learn more about that too.

Now. I've played with smb.conf and webmin and swat, and # smbclient2 -L localhost returns this:

 

<" share's and all that stuff that I've set.....">

 

Server.......................................... Comment

---------------------------------------------------------

PENTIUM (that's Linux)....................Samba_Server_2.2.8a

XP1900 (that's Windows).................My windows Comp

 

Workgroup...................................Master

-----------------------------------------------------------

HOME...........................................XP1900

 

I tried to set linux as the master and then windows etc, etc.....

 

thanks for your help.

Link to comment
Share on other sites

Hmmm...

 

First a few definitions: smbclient is the program that allows your linux machine to communicate with your windows machine. samba is the program that allows your windows machines to communicate with Linux.

 

With that out of the way.

 

Have you gone into SWAT and manually added the windows user accounts to Samba? (You did not say explicitly whether you had done this that is why I am asking.) If not, I would do this first.

 

Second, are the user accounts on windows the same as on Linux - same userid and same password?

 

Third, can you post your smb.conf and samba password file so that I, and others, can have a look at them. (change the passwords if it poses a security threat).

 

If you can ping the machine, then you can connect to the machine, it is just a matter of getting all the settings correct.

Link to comment
Share on other sites

Have you gone into SWAT and manually added the windows user accounts to Samba? (You did not say explicitly whether you had done this that is why I am asking.) If not, I would do this first.

 

:oops: OK, I don't remember doing this in my previous attempt, on mdk 9.1. I remember mapping UNIX->WINDOWS users thingy and that worked.

I rekon this is my problem, but I don't see a specific setting to add pc users? I only have myself to add as a pc user (Arthur) and in Linux, there is Root (me again) and Arthur (me again!)

How would I add Arthur (windows) as a smbuser if arthur(Linux) is added already and user.map says arthur=Arthur, etc etc....

I'm trying to figure a (easy)way to post my smb.conf file. Posting my password file don't worry me but how does this help.

 

I thought that smbclient was the program that allows any smb machine (L/Unix or Win) to view smb shares (L/Unix or Win), and samba was the controlling server. :unsure:

Anyhow, The reason I posted my smbclient command, is that now when I try exact same command (using scrolling method via up/down keys; ie no typo error) I type in my password(no problems) and my shares are listed, but under the Server, Comment, Workgroup and Master headings there are no lists, as if I have no workgroup or server etc... very strange. I can't see anything from windows in LinNeighborhood. I may be having trouble with lmhosts too. I tried the same command with the name of my Win box (XP1900) and it gave an error about 'no name resolved' or something. I tried the IP and it worked ok. This is all hit and miss, one time it works, the next it won't. The only consistent problem is Windows cannot connect to samba.

I'm going to delete all samba configs and samba and re-install and start from scratch( maybe with 3.0.0).

If you could advise me on how to explicitly add my windows user to samba, I would be most grateful.

 

cheers fuzzylizard.

 

ps.while typing this reply I sort of got LinNeighborhood working again. And I don't mind adding to the smb.conf without swat or webmin, just not 100% sure of the exact syntax, even though I could use testparm :zzz:

 

and here's a config (one of many)

--------------------------------------------------------

# Samba config file created using SWAT

# from UNKNOWN (127.0.0.1)

# Date: 2003/11/19 23:49:20

 

 

# Global parameters

[global]

workgroup = HOME

netbios name = PENTIUM

map to guest = Bad User

null passwords = Yes

username map = /etc/samba/user.map

max smbd processes = 4

preferred master = Yes

wins support = Yes

hosts allow = 192.168.0.1-192.168.0.3

hide dot files = No

 

 

[/NT_share]

path = /NT_share

guest ok = Yes

-------------------------------------------------------------

Link to comment
Share on other sites

How to add users to samba

 

Start SWAT and log in as root

Click on the Password tab at the far right

Under 'Server Password Management' add the details for your first user

Click on 'Add New User'

Repeat for all users

 

That is all there is to it.

 

 

As for you config file, make sure that you set Read Only = No

Otherwise, you will not be able to write to the share.

 

After you have done all this, remember to reload/restart samba.

Link to comment
Share on other sites

Hi again FL,

Ok I must be missing something here, is there a way to explicitly add a windows user?

The reason I ask is, I have Arthur as my windows user and Arthur as my Linux user. So do I add windows Arthur as Arthur@PC or something, because even though I reaslised that I'd already done what you recommended with add user, I'd done it again. To be sure to be sure.... :P

Otherwise I should create a new windows user call Tux'er or something to stop the confusion with my two identities.

I also enabled 'allow null passwords' but it forced me to type a password and I did forget to set 'readonly = no'

Link to comment
Share on other sites

It is not that you need to add an explicit window user to samba, it is that you need to explicitly add users to samba. The disctinction is small, but very important.

 

You are not really adding window users to samba. All you are doing is adding users to samba.

 

Therefore, if the user is the same on both machines -- same userid and password -- then you just need to add that user once. Once the users are added, they should be able to access the share from any windows computer they log into attached to the network.

 

Also, if you have another linux computer running samba and the same user on it, then you can use samba to access the share on the linux server. (follow that??)

 

 

My suggestion - remove all mention of the share in your samba config file, remove all users you may have entered and start all over again. Create the share and then add the users.

Link to comment
Share on other sites

Hi again fuzzylizard,

Thanks for your help in all this. Are you using mdk 9.2rc2 & winXP (SP1) ?

Maybe this is my problem.

I just tried to configure and run winbind without luck too. :wall:

I'm going to start again but maybe with the final release CD's, now that they're public.

 

cheers and seya again.

Link to comment
Share on other sites

I am running 9.2 with win98, 2000, and XP. And all computers can connect with no problems to the Linux machine.

 

Any particular reason you want to set samba up as a wins server? This is something that I have not done. I always thought wins was for domains as opposed to workgroups. That may be part of the problem.

 

If you start over, maybe leave the wins part off and just go with workgroups and a very simple setup. If you want, later today I can post my smb.conf file for you to look at, that may help you out some.

Link to comment
Share on other sites

If you could post your smb.conf file that would be a big help. But as I said I configured samba B4 with redhat too and it never gave probs like this.

I've tried everything with this configuration, and have resorted to trying winbind and wins, still no luck, but I'm getting the impression that something is changing the way that windows is attempting to log on to the samba server. Having done all this now the windows machine takes about 1 minute to attempt to log in, but still returns the warning that I'm not authorised to do so.

Anyhow as I type this I'm in the process of installing samba 3.0.1pre and see how this does. If I have no luck then I'll try 2.2.7a from mdk9.1 or something. I have a suspicion that something in the 2.2.8a version has not installed or is messed up or something.

 

cheers.

Link to comment
Share on other sites

What have you changed on the windows machine? Good luck with Samba 3.0. Tell me how the install and config process goes. Does SWAT work with 3.0?

 

As soon as I get back to my Linux computer, I will post my samba config

 

[global]

workgroup = GAMEFEST

netbios name = RIVENDELL

server string = Samba Server %v

encrypt passwords = Yes

map to guest = Bad User

log file = /var/log/samba/log.%m

max log size = 50

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

printcap name = cups

dns proxy = No

printer admin = @adm

printing = cups

 

[homes]

comment = Home Directories

read only = No

browseable = No

 

[Rivendell]

path = /share

read only = No

 

Aha - just caught something from the config file that you posted. You forgot to turn on encrypted passwords. If this is not turned on, windows computers will never be able to connect.

 

also, check the smbpasswd and make sure that you have something there. This is where samba places the users you added through SWAT. If there is nothing there, then you have no users that can access your share. In addition, although this should not matter, try removing the '\' from the name of your share. This may be messing up the naming convention as it would produce something like the following:

 

\\Host\\Share

 

instead of

 

\\Host\Share

 

 

Anyway, hope the above helps.

Link to comment
Share on other sites

)Thanks fuzzylizard for your .conf file. I didn't know about the encrypted password thingy. I hope this is the problem.

I'm going to re-install 9.2 from the new public releases.

Reason; trying to install samba3, requires perl-basex.x.x (5.8.2??) I can't remember now but it destroyed my ability to urpmi (and a host of other things)

So I guess samba3.0.1 is not really ready for non-guru's like me yet.

I just downloaded the iso's (I love cable :D ) and started backing up some stuff.

 

I'll use your .conf as a guide, but I see that your 'Homes' dir is set to browseable = no. Why? I did see that /NT_share thing earlier and fixed it, but that made no difference.

 

thanks again, and seeya soon

 

ps. How do I format a drive in Linux, it's not important and the reason I haven't checked man pages and stuff is because Partitionmagic8 does an OK job of it.

Link to comment
Share on other sites

Not completely sure why Home is set to browseable=no. I will have to look that one up.

 

As for formatting linux partitions, when you run the installer for 9.2, you will be given this option. Hope the new install works out better for you.

 

Ya, the encrypted password thing can really get ya. If that is not set to yes, then nothing you ever do will work with winNT, 2000, XP passwords.

Link to comment
Share on other sites

Having problems installing :angry:

I also upgraded the firmware on my router (what else am I going to do for 3 hours while I figure out how to install 9.2) and now my ability to add a reply to these forums has improved :thumbs:

Previously it could have taken 2 minutes from when I hit the reply button for the 'post reply' page to load. So I'll be posting more often in these forums, now that I realise I like mandy more (despite the samba prob (which is my doing))

Now I'm going to have to join the mandrake club too :jester:

 

thanks dude, I'll let you know how the password thing goes if I ever get 9.2 installed.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...