Get acces to your Kubuntu samba server

Posted by Flo in Tech, Tricks on May 6th, 2012.
Tags: , , , , , , ,

While trying to access some files on my Kubuntu computer from Mac OS X through samba, I ran into the problem that the password I set in the Kubuntu’s system settings for network sharing was denied. It turned out that it wasn’t even accessible through smbclient from the machine itself, and it resulted in a NT_STATUS_ACCESS_DENIED error. The fix was actually quite simple and probably the result of lazy reading when I was setting up the samba server. Read on if you’ve got the same problems.

Problem:

Access to the samba server running on the Kubuntu (12.04 but I had the problem with earlier verisons) computer is denied. You can check this with the following steps:

  1. Open a shell: (Alt+F2, type Konsole and enter). 
  2. type the following command:

    $ smbtree

    This will show you all services available in your network. If you’ve shared a folder, an entry like: \\YOURPC\sharedfolder will be in the list.

  3. Now try to access your shared folder using the following command:

    $ smbclient \\\\YOURPC\\sharedfolder

    If you have the same problem as I did, whatever user/password combination (even the one you set in System Settings->Sharing) you will use, you’ll end up in a NT_STATUS_ACCESS_DENIED error.

Solving the problem:

The problem is solved by manually adding a user/password combination to your server. Apparently the system settings->Sharing menu doesn’t do that for you.

In the shell, type:

$ sudo smbpasswd -a <username> 

In this command, replace <username> with a name of user that is registered on your Kubuntu installation, for example your own username. The command will fail if the user is not a registered system user.
The command allows you to set a samba server password for the user.

You should now be able to access the shared folder with this username, password combination.

Note. It’s still possible that you will still be having trouble accessing the shared folders from a Mac OS X computer. Several sources report that you should set 

encrypt passwords = yes

in the [global] section of your etc/samba/smb.conf file. My installation has several versions of this file, and I changed all of them just to be sure. You can find these files by using find:

$ sudo find / -name smb.conf

Good luck!





Leave a Reply

*