Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > Mounting Volume over SSH/sftp applications

Mounting Volume over SSH/sftp applications
Thread Tools
Fresh-Faced Recruit
Join Date: Sep 2006
Status: Offline
Reply With Quote
Sep 3, 2006, 11:59 PM
 
I can't seem to determine how to do this.

I've got a remote server that only supports SSH and FTP access. I want to set it up so that I can edit text files directly on that server. Normally, I would mount a network drive over AFP. I've worked in a situation where the network drive was mounted over other protocols, but I do not know how to do this.

I attempted to use Connect To Server (Command+K) to connect, but discovered that FTP through Finder only allows Read access, and no write access.

How can I mount these remote files as a volume of some sort?
     
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Sep 4, 2006, 12:29 AM
 
You can't do this with the Finder, but TextWrangler will let you directly edit text files on an SFTP (SSH) server.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Fresh-Faced Recruit
Join Date: Sep 2006
Status: Offline
Reply With Quote
Sep 4, 2006, 12:34 AM
 
Originally Posted by CharlesS
You can't do this with the Finder, but TextWrangler will let you directly edit text files on an SFTP (SSH) server.

Yes, I've found a number of solutions such as this (I happen to be using TextWrangler right now... though I think that if jEdit was built more for MacOSX I'd prefer it). I'd like something more elegant, however. I'd like to use the editor(s) of my choice on the files, and have this integration at a lower level. I recognize that there's no way to do it through finder, but what about a way to do it through the Terminal at a more basic level? I tried taking a look at the mount command, but I don't know quite enough about filesystems to figure it out.
     
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Sep 4, 2006, 12:37 AM
 
OS X doesn't include an SFTP file system driver, so there's no way that I know of to do this except to use a text editor that does SFTP.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Fresh-Faced Recruit
Join Date: Sep 2006
Status: Offline
Reply With Quote
Sep 4, 2006, 12:42 AM
 
Thanks, Charles... guess I'll work with the texteditors directly then.
     
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Sep 4, 2006, 04:13 AM
 
No, no, no.

SSH is more than enough. You can do AFP through SSH tunneling and then you can mount your drives, copy, move, etc. just as you otherwise would.

In your ~/.ssh/config add something like
Code:
Host remoteMac User yourName Hostname remoteMac.whereever.com # afp LocalForward 9548 remoteMac.wherever.com:548
Whenever you want to mount the volume, open an ssh connection like

Code:
ssh yourName@remoteMac
Then, in the finder, open the 'Connect to Server...' dialog and instead of just using "remoteMac" the way you used to, you enter
Code:
afp://remoteMac:9548
Done.

Basically, you just tunnel all AFP traffic (port 548) over ssh. The tunnel takes all traffic on your local port 9548 and relays it to the remote AFP port. Simple but useful.
     
Senior User
Join Date: May 2002
Location: Austria
Status: Offline
Reply With Quote
Sep 4, 2006, 04:54 AM
 
Simon's solution is great, however, it will only work if the remote computer is a Mac with File Sharing turned on.
If it isn't, try an SFTP client like Transmit (trial version available). It lets you browse your remote files and edit any file with any editor. It does that by downloading the file to a temporary directory, opening it with the application of your choice, and everytime you save changes to that file, it automatically uploads the file back to the (S)FTP server. It works absolutely transparently, so it really appears as if you could directly edit files on the server.
     
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Sep 4, 2006, 05:45 AM
 
Darn, I thought the OP had written he can use AFP on the remote machine. Need more coffee.

If only FTP is available, the ssh tunneling method will still work however. You just have to use the FTP port 20 instead of the AFP port 548.

Actually, you could also just forget ftp altogether and use scp (which uses an ssh connection) instead. You can get the files with scp, modify them locally and send them back with scp again. Check out man scp. It's simple and fast.
     
Moderator
Join Date: May 2001
Location: Hilbert space
Status: Offline
Reply With Quote
Sep 4, 2006, 06:01 AM
 
It seems like this thread is moving towards software … moving

There are numerous free sftp-capable applications (fugu, CaptainFTP), so you don't even have to pay for them. Simon's suggestion sounds great, I need to give that a try with my parents' Mac

Edit: I've decided to change the title accordingly.
I don't suffer from insanity, I enjoy every minute of it.
     
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Sep 4, 2006, 09:07 AM
 
FTP or AFP over ssh works great with the method I described. I use it every day because my lab has closed all ports other than 22 for incoming traffic. Whenever I want to get onto my work Macs from home, that's the easiest way to get it done. And you get secure encrypted data transmission for free too.
     
Moderator
Join Date: May 2001
Location: Hilbert space
Status: Offline
Reply With Quote
Sep 4, 2006, 11:06 AM
 
Sure, that's great to know. I knew that it was technologically feasible, but I have never really looked into it. Now that I know it's so trivial, I will definitely give it a shot.
I don't suffer from insanity, I enjoy every minute of it.
     
Mac Elite
Join Date: Oct 2000
Location: Edinburgh, Scotland
Status: Offline
Reply With Quote
Apr 19, 2007, 04:54 PM
 
Sorry to dredge up an old discussion but I was just looking for the same thing and came across this thread as well as a proper solution to the original poster's request. Have a look at sshFS - it does exactly what you're looking for, is free and open source

Basically, download and install (the installer prompts you to restart but if you know how to load a kernel extension there's no need to).
In the terminal:
Create a new directory
code:
mkdir -p ~/sshfs/XYZ

Mount the remote home directory over ssh:
code:
/Applications/sshfs/bin/mount_sshfs yourRemoteUsername@your.ssh.server.org: ~/sshfs/XYZ


You can call the mountpoint anything you like so long as it's the same in both commands.

Unmount the volume in the usual command-line fasion:
code:
umount ~/ssh/XYZ
( Last edited by Geobunny; Apr 19, 2007 at 05:01 PM. )
ClamXav - the free virus scanner for Mac OS X | Geobunny learns to fly
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Apr 19, 2007, 05:00 PM
 
Here is an article I wrote about using SSHfs in OS X:

NetMusician Labs Blog Archive FUSE and sshfs in OS X
     
Dedicated MacNNer
Join Date: Feb 2001
Location: Victoria, BC, Canada
Status: Offline
Reply With Quote
Apr 19, 2007, 07:32 PM
 
Yeah the macfuse project is really very cool - and works well.

I do, however, prefer the Transmit / text editor method.
     
Dedicated MacNNer
Join Date: Jun 2006
Status: Offline
Reply With Quote
Apr 20, 2007, 03:24 PM
 
I prefer just using vi.
     
Clinically Insane
Join Date: Dec 1999
Status: Offline
Reply With Quote
Apr 20, 2007, 03:56 PM
 
Originally Posted by kamina View Post
I prefer just using vi.
I prefer just using emacs. *ducks*
"…I contend that we are both atheists. I just believe in one fewer god than
you do. When you understand why you dismiss all the other possible gods,
you will understand why I dismiss yours." - Stephen F. Roberts
     
Mac Elite
Join Date: Oct 2000
Location: Edinburgh, Scotland
Status: Offline
Reply With Quote
Apr 20, 2007, 04:41 PM
 
Originally Posted by kamina View Post
I prefer just using vi.
Oh dear, there's always one, isn't there!

Can I be bothered having the vi vs. emacs vs. nano debate? Actually, no I can't, so here's a wee song instead (and here's the tune if you can't remember how the verses go)

Apologies to everyone who heard it first time around....18 years ago!
ClamXav - the free virus scanner for Mac OS X | Geobunny learns to fly
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -4. The time now is 03:17 AM.
All contents of these forums © 1995-2014 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2014, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2