Samba Authentication error

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
 
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.
 
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.
 
# 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?
 
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.
 
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 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?
 
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.
 
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.
 
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:
Back
Top