Header Shadow Image


Mount Samba Share on Ubuntu

Getting this?

root@g73sw01:~# mount -t cifs -o credentials=/home/unbeknownst/.smbcredentials,vers=3.0 //nfs-c01.nix.mds.xyz/nfs-bob ./test -vv
mount: /root/test: mount(2) system call failed: No route to host.
root@g73sw01:~#

Solve it with:

root@g73sw01:~# apt-get install keyutils cifs-utils

Next hurdle, was the following:

tom@g73sw01:~$ id
uid=1000(tom) gid=1000(tom) groups=1000(tom),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),122(lpadmin),135(lxd),136(sambashare)
tom@g73sw01:~$ mount -t cifs -o credentials=$(pwd)/.smbcredentials,vers=3.0,uid=1000,gid=1000 //nfs-c01.nix.mds.xyz/nfs-vincent ./samba
mount.cifs: permission denied: no match for /home/tom/samba found in /etc/fstab
tom@g73sw01:~$

Strangely enough, the solution for this one is NOT to use mount -t cifs , but mount.cifs:

tom@g73sw01:~$ sudo mount.cifs //nfs-c01.nix.mds.xyz/nfs-vincent /home/tom/samba -o credentials=$(pwd)/.smbcredentials,vers=3.0,uid=1000,gid=1000
[sudo] password for tom:
tom@g73sw01:~$

Testing this out a bit further, reveals the mount needs to be done via sudo:

tom@g73sw01:~$ mount -t cifs //nfs-c01.nix.mds.xyz/nfs-vincent ./samba -o credentials=$(pwd)/.smbcredentials,vers=3.0,uid=1000,gid=1000
mount.cifs: permission denied: no match for /home/tom/samba found in /etc/fstab
tom@g73sw01:~$ mount.cifs //nfs-c01.nix.mds.xyz/nfs-vincent ./samba -o credentials=$(pwd)/.smbcredentials,vers=3.0,uid=1000,gid=1000
mount.cifs: permission denied: no match for /home/tom/samba found in /etc/fstab
tom@g73sw01:~$ sudo mount -t cifs //nfs-c01.nix.mds.xyz/nfs-vincent ./samba -o credentials=$(pwd)/.smbcredentials,vers=3.0,uid=1000,gid=1000
tom@g73sw01:~$

Not the best error message to indicate the real reason for the mount failure.  Testing from another user, reveals access denied:

[tom@mds.xyz@g73sw01:~] :([U]$ pwd
/n/mds.xyz/tom
[tom@mds.xyz@g73sw01:~] :)[U]$ cd /home/tom/samba
bash: cd: /home/tom/samba: Permission denied
[tom@mds.xyz@g73sw01:~] :([U]$

Perfect!

Cheers,
HTH

Subscribe
Notify of
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

     
  Copyright © 2003 - 2025 Tom Kacperski (microdevsys.com). All rights reserved.

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License

 

0
Would love your thoughts, please comment.x
()
x
The IT Development and Technology Mini Vault | MicroDevSys.com
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.