projectz

Tech, Gadgets, Photography, Social Media and Poor Spelling

Connecting to SMB shares from the command line in OS X

Connecting to SMB shares from the command line in OS X

I’ll keep this one short for brevity. It’s sweet and simple. If you’re anything like me you’re probably using at least 10 different operating systems at once. Well, that might be a slight over exaggeration, but I certainly use at least three in my home. Here’s the problem that I faced this evening and how I overcame it.

I have a linux server which is sharing some data using a samba share (SMB). Connecting to this from my windows box is simple, since microsoft is good enough to make mounting shares over SMB a piece of cake. My MacbookPro running OS X Lion, however, was a different story.

One option is to use the finder to manually connect to the share, but since I often connect to various computers using SSH I wanted to find a purely command-line solution. Thankfully, it’s super simple. Just use the UNIX command mount – as follows:

mount -t smbfs //<username>@<ip or fqdn>/<share name> <mount point>

The example of this on my network is as follows:

mount -t smbfs //james@192.168.0.4/james /Users/jamesanslow/linuxserverfiles

Note: you will require smbfs + samba installed + configured for this to work (duh?)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Information

This entry was posted on October 20, 2011 by in link and tagged , , , , , , , , .
%d bloggers like this: