Samba Authentication error

kr651129

Well-Known Member

Reaction score: 7
Messages: 332

I'm trying to mount my samba share on FreeBSD 9.1 via the following

Code:
# mount_smbfs //kclark@server/samba "./My Music"
Password:
mount_smbfs: unable to open connection: syserr = Authentication error
I'd really like this to automount on boot but I need to get this working first.

Here's my smb.conf

Code:
[global]
workgroup    = SMB
netbios name = SERVER
security     = user

[samba]
writeable     = yes
path          = /usr/home/samba
public        = yes
guest ok      = yes
guest only    = yes
guest account = nobody
browsable     = yes
 

gkontos

Daemon

Reaction score: 483
Messages: 2,155

Have you added the user in samba?

[CMD=""]# smbpasswd -a <user>[/CMD]
 

kpa

Beastie's Twin

Reaction score: 1,818
Messages: 6,318

You have guest only = yes in your configuration, that will allow only guest logins without a password. Turn that off to use the real user accounts for login.
 

mamalos

Well-Known Member

Reaction score: 49
Messages: 446

Moreover, in order to debug your connections more thoroughly -and not deal with probable configuration issues of mount_smbfs-, use:

$ smbclient //server/samba -Ukclark

followed by your password to see that everything is fine. If in doubt, check what shares are present with:

$ smbclient -L server -U%

If the above work, while mount_smbfs fails, post us the contents of your ~/.nsmbrc file.
 
OP
K

kr651129

Well-Known Member

Reaction score: 7
Messages: 332

# smbpasswd -a <user>

Solved this for me, but my next question gets a little more complex. I want to automount the share via /etc/fstab but I'm being prompted for a password, I'd like to not have to enter a password, but here's the tricky part, if I'm at home I want an entry for my server behind the router, when I'm connected elsewhere I want an entry for my static IP, when FreeBSD loads the /etc/fstab will it pass over the "invalid" entry or will it error out on me and force me to fix this in single user mode?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 8,775
Messages: 33,056

kr651129 said:
when FreeBSD loads the /etc/fstab will it pass over the "invalid" entry or will it error out on me and force me to fix this in single user mode?
It will error and drop you to single usermode.
 
OP
K

kr651129

Well-Known Member

Reaction score: 7
Messages: 332

Is there a way around this or is my best bet writing a bash script that autoruns on login?
 
OP
K

kr651129

Well-Known Member

Reaction score: 7
Messages: 332

Well I wrote this script and it seems to work fine, but I need to get around the password request

Code:
#!/usr/local/bin/bash

echo "Checking to see what router we're connected to..."
echo ""


SSID=$(/sbin/ifconfig | grep ROUTERNAME)

echo "Connected to "
echo $SSID


if [[ "$SSID" == *ROUTERNAME* ]]
then
        echo "Connecting to krisbox from inside the network"
        mount_smbfs //kclark@server/samba "/usr/home/kclark/My Music"
else
        echo "Connecting to krisbox from outside the network"
        mount_smbfs //kclark@xxx.xxx.xx.xxx/samba "/usr/home/kclark/My Music"
fi
 

gkontos

Daemon

Reaction score: 483
Messages: 2,155

kr651129 said:
Well I wrote this script and it seems to work fine, but I need to get around the password request
See here for bypassing the password. You can also adjust your script.
 
OP
K

kr651129

Well-Known Member

Reaction score: 7
Messages: 332

gkontos said:
See here for bypassing the password. You can also adjust your script.
Thanks for the link, I tried that and it still is prompting me for a password, this might be a stupid question, but that file goes on the client box right?
 

gkontos

Daemon

Reaction score: 483
Messages: 2,155

kr651129 said:
Thanks for the link, I tried that and it still is prompting me for a password, this might be a stupid question, but that file goes on the client box right?
Correct, have you tried to declare the user in capital in .nsmbrc? You can also add the credentials in the fstab but this is not recommended.
 
OP
K

kr651129

Well-Known Member

Reaction score: 7
Messages: 332

I did, I can't remember how off hand but I'm testing 10.0-BETA2 right now and I'll be setting this up again, when I do I'll let you know what the solution was.
 

Sean G

New Member

Reaction score: 1
Messages: 1

I know this is an older thread but I just went through the same problem with 10.3

After a lot of trial and error, I found that server name and username must be in capitals.

Code:
[SERVERNAME]
addr=192.168.1.nn

[SERVERNAME:USERNAME]
# use persistent password cache for username
password=PasSwoRd
Hope this saves someone some time...
 
Last edited by a moderator:

xelfer

New Member


Messages: 1

I know this is an older thread but I just went through the same problem with 10.3

After a lot of trial and error, I found that server name and username must be in capitals.
This did fix my issue, thank you.
 
Top