How to Mount a Samba share to your Computer in Linux

This is something that I’ve been wanting to do for some time. It’s just this morning that I actually decided to do it. It’s pretty simple.

This small tutorial is based upon the assumption that you already have a samba share set up. However, if you don’t, then keep posted, because I’ll talk about that in a later tutorial. Also, It’s based upon the assumption that you have the samba client and sambafs installed. In debian all that you have to do to install this is type in the following line:
apt-get install smbfs smbclient

All that you have to do is type in the following command to have a non-permanent solution (on one line):
mount -t smbfs //[server ip or domain name]/[server directory] [place that you want to mount the directory] -o username=[samba username],password=[samba password]

If you go with this solution you’ll have to reenter this command each time that you start up your computer. To make this a permanent change, you need to edit your ‘/etc/fstab’ file by adding the following line at the bottom (on one line)
//[server name or ip]/[shrae name] [directory to mount share into] smbfs username=[samba username],password=[samba password] 0 0

This works for me, but if you have any problems feel free to leave a comment and I’ll help you out ASAP.

Later,
Jon Howe

2 thoughts on “How to Mount a Samba share to your Computer in Linux

  1. It didn’t work for me.!!!!

    The below line is working:

    mount -t smbfs //[server ip or domain name]/[server directory] [place that you want to mount the directory] -o username=[samba username],password=[samba password]

    But I can’t make it permanent!

  2. Were there any errors in /var/log/syslog, or /var/log/messages when you restarted? If so, what were they? If not, did you create the directory that you told /etc/fstab to mount the share onto. Did you enter the credentials on the fstab line correctly? Finally, do you have the correct permissions set on the remote share, and the local share?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Copyright VirtJunkie.com © 2020