Wednesday, March 5, 2014

Connect to SMB share with terminal - Fedora20

The non-gui way to connect to your SMB share. There is likely 1000 small variations of how to do this, but this is a very simple method to get you on to the path to bigger, better, cooler...

From a terminal:
[user@localhost user] $ cd /mnt
[user@localhost mnt] $ sudo mkdir shareExample
[user@localhost mnt] $ sudo mount -o username=user //theShareLocation/shareName /mnt/shareExample/
You will likely be prompted for your passwd...
[user@localhost mnt] $ cd /mnt/shareExample
[user@localhost shareExample] $ look around, do stuff...

NOTE: If you're accessing a SMB share on windows you will like need to connect using:
[user@localhost mnt]$ sudo mount -t smbfs -o username=username //theShareLocation/shareName /mnt/shareExample/

...and when you're done:
[user@localhost mnt]$ sudo umount /mnt/shareExample

This should work on all flavors of *nix, done here on Fedora20 as that is what I'm using at the moment.

FIN