sudo apt-get install smbnetfs
mkdir ~/.smb
cp /etc/smbnetfs/smbnetfs.conf ~/.smb
cp /etc/samba/smb.conf ~/.smb
tee ~/.smb/smbnetfs.auth <<EOF
auth HOSTNAME USERNAME PASSWORD
EOF
chmod 600 ~/.smb/smbnetfs.auth
Mount
mkdir MOUNTPOINT
smbnetfs MOUNTPOINT
ls MOUNTPOINT/WORKGROUP
ls MOUNTPOINT/HOSTNAME
ls MOUNTPOINT/USERNAME:PASSWORD@HOSTNAME/SHAREPOINT
Unmount
fusermount -u MOUNTPOINT
sudo tee -a /etc/resolvconf/resolv.conf.d/base <<EOF
search mydomain.com
nameserver 192.168.0.1
EOF
sudo resolveconf -u
I got it to work using Kerberos authentication:
apt-get install krb5-user
Configure
/etc/krb5.conf
:Get a Kerberos ticket using
kinit -r28d [email protected]
Validate that it works using
smbclient -k -U [email protected] -L //hostname.your.ad.domain.in.whatevercase
Run
smbnetfs ~/mountpoint
Access Windows stuff using
ls ~/mountpoint/hostname.your.ad.domain.in.whatevercase/sharename/folder/file.txt
Step 3 fetches a renewable Kerberos Ticket, which I combined with an hourly cronjob to renew it:
The
~/mountpoint
dir was empty, but accessing the files worked regardless. Adding a~/.smb/smbnetfs.host
file made my target host appear in the directory so that I can use tab completion for convenience, but file access worked without it.