 |
 |
Mounting Volume over SSH/sftp applications
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Sep 2006
Status:
Offline
|
|
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
|
|
You can't do this with the Finder, but TextWrangler will let you directly edit text files on an SFTP (SSH) server.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Sep 2006
Status:
Offline
|
|
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
|
|
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.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Sep 2006
Status:
Offline
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Oct 2000
Location: Edinburgh, Scotland
Status:
Offline
|
|
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:
(Last edited by Geobunny; Apr 19, 2007 at 04:01 PM.
)
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Online
|
|
|
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Feb 2001
Location: Victoria, BC, Canada
Status:
Offline
|
|
Yeah the macfuse project is really very cool - and works well.
I do, however, prefer the Transmit / text editor method.
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Jun 2006
Status:
Offline
|
|
|
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Dec 1999
Status:
Online
|
|
Originally Posted by kamina
I prefer just using vi.
I prefer just using emacs. *ducks*
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Oct 2000
Location: Edinburgh, Scotland
Status:
Offline
|
|
Originally Posted by kamina
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!
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|