up vote -1 down vote favorite
share [g+] share [fb]

I was wondering how to connect to a network storage through the command line on my MacOSX computer, any tips?

link|improve this question
A mounted directory or other network service? Please describe. – Xepoch Nov 13 '09 at 23:17
It's a network service, my school provides 2gb of storage and I would like to write a script that connects to it. – NickTFried Nov 14 '09 at 1:30
1  
We need more information on what kind of 'network storage' is being provided, and what interface is required to use it. – Ex Umbris Nov 14 '09 at 1:37
I guess I don't really know sorry – NickTFried Nov 14 '09 at 20:36
feedback

migrated from stackoverflow.com Nov 14 '09 at 20:56

This question came from our site for professional and enthusiast programmers.

2 Answers

As said before it depends on sharing protocols.

You can connect to a server (while in Finder) with :

Cmd + k

You have to find out which protocol is used for sharing ... (smb, afp, ...) !

My first guess will be : smb (samba)

In the Server Address field enter:

smb://serverhostname.domain/pathtoyourhomefolder

Save it to your Favorite Server list (+ button)

Then hit Connect, your remote folder will automatically be mounted on your Desktop.

About command line (if the sharing is SMB) : man smbclient is your friend

link|improve this answer
feedback

If you're trying to mount a file system you should use one of the mount_* commands.

As an example, I have a script that periodically mounts a SMB volume, copies some files and then unmounts:

mkdir /Volumes/[mountpoint]
mount_smbfs //[username]:[password]@[hostname]/[sharename] /Volumes/[mountpoint]
... copy some files ...
umount /Volumes/[mountpoint]

This assumes you have permissions to create a directory in /Volumes. Any directory will do, really - you just need write permissions.

The URL for a mount point on a remote server if different for each protocol, check the particular man pages for more info.

In general, you need to create the mount point first using mkdir, but umount will delete it afterwards.

link|improve this answer
in linux smbfs and cifs are similar means to the same end; use cifs (eg mount_cifs) if available. – quack quixote Mar 29 '10 at 3:47
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.