Link to home
Start Free TrialLog in
Avatar of miauw
miauwFlag for Netherlands

asked on

configuring Samba (acces from W2K to Linux)

Thanks to someone here who directed me to http://www.linuxhelp.co.za/beginner.php I got Samba running, that is: one way only.

I can mount and access a windows share on my W2K server.
However I can't connect in the opposite direction:
 W2K sees in "Computers near me" the Linux box,
 with the description Samba server 2.0.7 or whatever
 I write in smb.conf, but when
 I want to explore it, it get a "\\Linuxbox is not accessible, this account is not authorized to login from the network"

I did create the (case sensitive) user (Testuser) + password (which is used on W2K in the same session I am using it to connect to Linux) on my Linux box and did the
cat /etc/passwd | /usr/bin/mksmbpasswd.sh > /etc/passwd
and the /usr/bin/smbpasswed -U Testuser .
The share in smb.conf is /home/Testuser and this does exists. I even did a chmod 777 on this dir.

Plz explain at a "Linux novice level", since I am new to Linux. However, I prefer editing the textfiles, rather then using a GUI tool which may or not may do something mystical in the background which usually doesn't seem to work.

W2K box = W2K server in same segment
Linux box = Mandrake 8.0 running Gnome

TIA, Miauw
Avatar of ahoffmann
ahoffmann
Flag of Germany image

> cat /etc/passwd | /usr/bin/mksmbpasswd.sh > /etc/passwd

That was a bad idea :-((
Hope you've a backup copy of /etc/passwd to restore, otherwise you'll have problems on your Linuxbox.

You should do something like:

     smbpasswd Testuser   # then type password at prompt

     # then stop and start samba server again
Avatar of miauw

ASKER

Oops, there was a large typo in my question (forgot the smb):
I actually did a:
cat /etc/passwd | /usr/bin/mksmbpasswd.sh > /etc/smbpasswd
smbpasswd -U Testuser  (prompted me for password which I supplied)
and then a samba restart (which prompted everthing is ok).



BTW: a strange thing occur with E-E, I got the emails about some questions 3 days delayed.


Let me try again.....
miauw
samba is in /etc/samba since RedHat 7.0, so unfortunately I gave you some outdated advice on my website, for your system you should use the line:
cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd

Then you do the rest as you did and then restart samba. The only reason your samba is not working now is because you made an smbpasswd file in the /etc folder, but your /etc/samba/smb.conf file says that your smbpasswd file is in /etc/samba/smbpasswd , so you just need to change the command (or change the .conf file to point to /etc/smbpasswd), but I would guess the first option is best.
Avatar of calvinrsmith
calvinrsmith

when I get that message it's because win2k is using encrypted passwords.  turn this off and you'll be set
No, he should NOT turn this option off! It requires that you go fiddle with win2k's registry, and it is totally unnecessary. You just need to make sure that you have the
"encrypt passwords = yes" and
"smb passwd file = /etc/samba/smbpasswd"
lines uncommented in the smb.conf file, and then run the commands as already described above.
If you remove the encrypted password support from the windows box, you could be opening security holes on your system/network.
if u select encrypt passwd. i think it would do it for ALL client
ASKER CERTIFIED SOLUTION
Avatar of Seever
Seever

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of miauw

ASKER

I tried to follow the tip of psimation. I
Since I am new to this, this I want I tried (only modified
the passwords):

1) W2K station = "__W2K", workgroup = "PRIVATE", share = "__testshare"

2) I give W2K user "__testuser" with password "__testpassword" permissions on "__testshare"

3) # /usr/sbin/samba start
->
  Starting SMB services : [ OK ]
  Starting NMB services : [ OK ]

4) # mount -t smbfs -o username=__testuser,password=__testpassword //__W2K/__testshare /home/samba/windowspc
-> this works, I can access the share

5) on W2K a user "Linuxaccess" with password "hidden" is logged on

6) on Linux box I create a user "Linuxaccess" with password "hidden"

7) I add "encrypt passwords = yes" and "smb passwd file = '/etc/samba/smbpasswd" to /etc/smb.conf

8) /etc#mkdir /etc/samba (the directory did not exist before I did this <----  so I think the path in smb.conf is wrong)

10) cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd

11) /etc/samba #ls
-> smbpasswd  (so the file is created)

12) /etc/samba *smbpasswd Linuxaccess
-> New SMB password: hidden
-> Retype new SMB password: hidden
-> startsmbfilepwent_internal: unable to open file '/etc/samba/smbpasswd'. Error was no such
file or directory.
smbpasswd file did not exits - attempting to create it
unable to open file '/etc/samba/smbpasswd'. Error was no such file or directory.
Failed to modify password entry for user Linuxbox
(I was root at this point)

13)/usr/sbin/samba start
  Starting SMB services : [FAILED]
  Starting NMB services : [ OK ]
 
___________
So I guess the /etc/samba/smbpasswd thing didn't work out to well for me.

After I get Samba working again (Linux to W2K) I will try to follow up other tips like the one from seever
Avatar of miauw

ASKER

In addition to my comment of Date: 10/24/2001 09:18AM PST;

when I remove both encrypt password = yes AND
 smb passwd file = '/etc/samba/smbpasswd'
 from the [global] session in /etc/smb.conf
  leaving one there -> Samba fails to start (altthough NMB starts)

Samba (that is access from Linux to W2K) works again.

Avatar of miauw

ASKER

I had problems accessing this site in the last week.
Anyway Samba works now.
The tips here did not really solved my answer
or pointed me to the right direction.

What did? I'm not exactly sure, since I configed
changes for other reasons as well and when I rebooted
both linux and W2000 it suddenly worked.

I feel the answer of Seever potentially is most usefull to others, that is why I accept his comment as a answer.