LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   problems with my samba server (https://www.linuxquestions.org/questions/linux-newbie-8/problems-with-my-samba-server-499979/)

Kanly6486 11-09-2006 02:51 AM

problems with my samba server
 
ok well i had the server up and runing but now i want to have it password protected, i would like either custom user names or the same ones i use to log on to ubuntu here is what i have in my smb.conf now

[global]

netbios name = samba
workgroup = MSHOME
security = share
log file = /var/log/samba.log
log level = 1
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=16384 SO_SNDBUF=16384
wins support = yes
domain logons = no
logon drive = f:
logon home = \\stefan\%U
os level = 99
preferred master = yes
local master = yes
hosts allow = 192.168.1.100 192.168.1.101 192.168.1.102 192.168.1.102 192.168.1.103 192.168.1.104
encrypt passwords = yes
browseable = yes
lanman auth = yes
lm announce = yes

[shared]
path = /mnt
guest ok = yes
writeable = yes
create mode = 0666
directory mode = 0777
browseable = yes
public = yes


i yanked it from another website and modified it for my own needs but once i insert the map user and such it either wont let me even touch the samba from my windows computer, or it will ask me for a user name and password and i cant use any of the things i put in there.

bob_man_uk 11-09-2006 04:39 AM

ok i have had this problem before,

IIRC the answer lies with smbpasswd.

the user trying to access the samba server needs to have a account exactly the same on the server

EG

windows user = aperson
*nix server user = aperson

do
smbpasswd aperson

and it should ask you to enter your password twice... just like passwd would.

try connecting now and see what happens.

hope it helps

Matty G

Kanly6486 11-09-2006 09:54 AM

Quote:

Originally Posted by bob_man_uk
windows user = aperson
*nix server user = aperson

are you saying that the windows login i use needs to be the same as the linux one? Also is there anything i need to put into my smb.conf file to get this to happen?

bob_man_uk 11-09-2006 10:12 AM

im not saying you have to or thats how its supposed to work, im jst saying thats what i did to get it to work.

im smb.conf i have valid users set to me and my boss bwallace, anyone else tries to access and they get told to bugger off, if my password doesnt match the unix one then it will prompt me for my uname and password.



Code:

[www]
path = /htdocs
valid users = mgilbert bwallace
public = yes
writable = yes
printable = no
create mask = 0644


my.dying.bride 11-09-2006 10:29 AM

Quote:

Originally Posted by Kanly6486
are you saying that the windows login i use needs to be the same as the linux one? Also is there anything i need to put into my smb.conf file to get this to happen?

No it doesn't. It's easier if it is though. But you can map a username from a windows machine, say "Super", to an account you already have on your linux ,say "Man". So when the windows user "Super" connects to your samba server, he connects as "Super" and this name is first checked against your linux userdatabase. If there are no matches, Samba will see if you have setup a mapping file it can use. If it finds that file , it may read "Man"="Super" or vice vers, it uses the account on your machine "Man" with its belonging user rights. It has been long long time since i did this, I can see if i find an old smb.conf , but I guess other people in here will be able to help you faster with this. You must enable the mapping in your smb.conf (forgotten Must google it..lazy me..), create the mapping file. BTW, lanmanager password is really weak and cracked easily. You only need it if you have <win98 machines in your lan that will connect to you. Otherwise set NT as min protocol.

Kanly6486 11-09-2006 11:37 AM

ok so just take out the lanman stuff? and i should put in
security = users
username map = /etc/samba/sambausers

and inside of the sambausers i should have my_linux_name = my_login_name

would that be correct?

my.dying.bride 11-10-2006 01:00 PM

Quote:

Originally Posted by Kanly6486
ok so just take out the lanman stuff? and i should put in
security = users
username map = /etc/samba/sambausers

and inside of the sambausers i should have my_linux_name = my_login_name

would that be correct?

It looks perfect at first sight. Your_login_name is the name used from your windows machine. A little but.. I used to study the logs from this process setting it up on my own, but like i said a lot is forgotten and the config files have been deleted with a harddisk crash (windows..). I think that after your username has now been mapped to my_linux_name, you may run into password problem if password my_linux_name<>my_login_name. If you increase the loglevel in your smb.conf (1 is default), up to 2 or 3 or 4 or sth.. you can study the logon ,handshaking, in detail to see where you are rejected. If it is bad username or bad password.

Sorry for not remembering all, but you are def. on the right track and train

There is also a goround.. Windows automatically tries to log on as current user, then as anonymous. And if you have allowed anonymous access, but want to log on as root, you should disconnect the mapped drive on your wndows desktop belonging to the linux server , but that windows automatically mapped read only as "anonymous=nobody" if guest login was allowed. Then you can remap it by using normal Windows "map network drive" wich allowes you to enter different username and password from the your "CurrentUser" credentials

Laughs... Sry my english. not a native :))

JimBass 11-10-2006 08:18 PM

Also, please remember that a samba account is NOT a linux account. What that means is if you and your boss have actual accounts on the linux machine, and try accessing them through samba, it will fail if you use the regular password. That is because samba can't read the file where the login passwords are stored. You really do need to run the smbpasswd command for each user who will log in through samba. You can make the samba password the same as the login password, although that would not be secure at all. Create the samba pass, and then all should go smoothly.

Peace,
JimBass


All times are GMT -5. The time now is 05:54 PM.