Ubuntu. Proper fstab entry to mount a samba share on boot?

0
=
0.2
+
0
No specific Bitcoin Bounty has been announced by author. Still, anyone could send Bitcoin Tips to those who provide a good answer.
0

How can I mount samba shared directory after system reboot?

I'm tried this:

mount -t cifs //server/dir /mnt/share -o username=user,password=password

Thanks.

Tags: , , ,

1 Answer

1
=
1
=
$0.2
1 tip with total amount of 0.62 mBTC($0.2 USD) have been sent by lampego

This method works in Ubuntu 12.01:

  1. Install cifs-utils: apt-get install cifs-utils

  2. Create file .smbcredentials:

    touch ~/.smbcredentials
    chmod 0600 ~/.smbcredentials
    
  3. Add to .smbcredentials your credintals:

    username=shareuser
    password=sharepassword
    domain=domain_or_workgroupname
    
  4. Edit your fstab file:

    nano /etc/fstab
    
  5. Add this line to fstab:

    /server/share /pathto/mountpoint cifs credentials=/home/username/.smbcredentials,uid=shareuser,gid=sharegroup 0 0
    
  6. Remount your drives(check errors):

    sudo mount -a
    

I hope it's helped you

SEND BITCOIN TIPS
User rating:

Thanks very much :)

User rating:
0

Too many commands? Learning new syntax?

FavScripts.com is a free tool to save your favorite scripts and commands, then quickly find and copy-paste your commands with just few clicks.

Boost your productivity with FavScripts.com!

Post Answer