1

I have a TrueNAS NAS smb share. My TrueNAS user settings have password disabled and I have added my SSH public key. I can SSH into the NAS using my private key with no issues. However, I am trying to figure out how to mount an SMB share to my linux machine.

/etc/fstab

//nasdomain/share /mnt/nas/share cifs username=nasusername,uid=linuxusername,gid=linuxusername 0 0

When I run sudo mount -a, I am promted to login to the share as nasusername. How do I login using my private key?

Is it possible to even login using key-pairs or does SMB only support user/pass? If impossible, what's the goto NAS fileshare that can use key-pairs?

1 Answers1

3

You don't – the SSH keys are only useful for SSH, which SMB is not.

SMB only supports NTLM (password-based) and Kerberos (MS AD) authentication. For NTLM auth (which is the only option on most non-AD systems), the SMB server will likely have its own password database separate from the rest of the OS.

(Kerberos supports private-key authentication, but it's still completely different from SSH keys.)

Use the sshfs or fuse.sshfs filesystem type for SSH-based SFTP file access (you'll need to have the sshfs package installed on the client). The performance of SFTP might be slightly worse than that of SMBv3.

grawity
  • 501,077