Mounting a Windows hosted samba share from Linux (Fedora/Ubuntu/etc) – with a domain account

Mounting a Windows hosted samba share from Linux (Fedora/Ubuntu/etc) – with a domain account

Samba shares can be finicky beasts. Mounting a samba (smb) point shared from a Windows host doubly tricky at times due to cross-platform differences such as domains.

If you ever find yourself trying to mount a Windows hosted Samba share and need to log in with a domain account, here’s the format:

sudo mount -t cifs -o domain=<YOURDOMAIN>,username=<YOURUSERNAME>,password=<YOURPASSWORD> //<HOSTNAME>/TestShare /mnt/

This mounts <hostname> which can be either an ip address or host name to the directory /mnt/ when using the proper domain, username and password. Whew.

You can also test your connection by using smbclient, which seems to have a more forgiving syntax.:

smbclient //<HOSTNAME>/TestShare -U <YOURDOMAIN>/<YOURUSERNAME>
ex:
smbclient //myhost.com/TestShare -U ibmdom/billwaters

This would connect you to myhost.com/Testshare directory using the user account billwaters that is part of the ibmdom domain. It would then prompt you for your password. You can also optionally add the password to the command line, but this allows you to type it in separately.

Leave a Reply

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