I have been trying to use the smbmount command since I upgraded to Hardy. I've read probably hundreds of posts, and I see that many others are having similar problems. Finally, I found something that worked, and I want to share it with others. I hope no one minds that I started this new thread - there were just too many questions out there, and I didn't want this info to get lost in the shuffle.
Here are the steps I took to get smbmount to work on my systems.
1) Make sure the following package are installed:
- samba
- smbfs
- winbind
2) Edit the file /etc/nsswitch.conf, changing the line that reads
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
to
hosts: files wins mdns4_minimal [NOTFOUND=return] dns mdns4
Between installing winbind and putting this line in the nsswitch.conf file, Samba on Kubuntu is able to find the Windows share (i.e., it solved the "could not find target server" error).
3) Restart samba with the following command:
$ sudo /etc/init.d/samba restart
4) Create a credentials file with your user name and password:
$ echo "username=myid
password=mypassword" > $HOME/.smbmount
** BE SURE NOT TO PUT SPACES BEFORE/AFTER THE EQUALS SIGN. That's what kept causing my error 13 - permission denied; I had spaces in there. Ugh!
5) Don't forget to change the security of the credentials file so only you can see it.
$ chmod 600 $HOME/.smbmount
6) Finally, mount the Samba share.
$ sudo smbmount //windowsservername/windowsharename $HOME/mymountpoint -o credentials=$HOME/.smbmount
Note that I am using the default /etc/smb.conf file that came with the install. You may need to change the workgroup or other settings in this file so it matches your Windows settings. You may also want to add some other options to the smbmount command such as uid= or gid=. If you do make changes, don't forget to restart Samba.
Here are the steps I took to get smbmount to work on my systems.
1) Make sure the following package are installed:
- samba
- smbfs
- winbind
2) Edit the file /etc/nsswitch.conf, changing the line that reads
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
to
hosts: files wins mdns4_minimal [NOTFOUND=return] dns mdns4
Between installing winbind and putting this line in the nsswitch.conf file, Samba on Kubuntu is able to find the Windows share (i.e., it solved the "could not find target server" error).
3) Restart samba with the following command:
$ sudo /etc/init.d/samba restart
4) Create a credentials file with your user name and password:
$ echo "username=myid
password=mypassword" > $HOME/.smbmount
** BE SURE NOT TO PUT SPACES BEFORE/AFTER THE EQUALS SIGN. That's what kept causing my error 13 - permission denied; I had spaces in there. Ugh!
5) Don't forget to change the security of the credentials file so only you can see it.
$ chmod 600 $HOME/.smbmount
6) Finally, mount the Samba share.
$ sudo smbmount //windowsservername/windowsharename $HOME/mymountpoint -o credentials=$HOME/.smbmount
Note that I am using the default /etc/smb.conf file that came with the install. You may need to change the workgroup or other settings in this file so it matches your Windows settings. You may also want to add some other options to the smbmount command such as uid= or gid=. If you do make changes, don't forget to restart Samba.
Comment