We help IT Professionals succeed at work.

configuring Samba (acces from W2K to Linux)

miauw
miauw asked
on
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
Comment
Watch Question

CERTIFIED EXPERT

Commented:
> 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

Author

Commented:
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.
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
Commented:
This is how i do it and this works.

check in smb.conf file

- encrypt passwords = yes
- smb passwd file = /etc/samba/smbpasswd
- username map = /etc/samba/smbusers

if more than 1 eth interface
- interfaces = 10.0.0.2/24 131.107.2.212/24

connect to directory.

[connection name]
comment = my info
path = /home/my directory
valid user = unix user
public = yes
writable = yes
printable = no
browseable = yes
create mask = 0765


add password to smbpasswd for valid user.

example: smbpasswd unix_user
         give password

add user to smbusers


in Windows2000

- create mapping to servername\connection name
- give username and password to connect

in Windows98

- create user with the same name in unix
- logon with that user
- create mapping

Author

Commented:
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

Author

Commented:
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.

Author

Commented:
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.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.