Best way to edit Linux server configuration files on Mac OS X? - macos

I'm used to editing my remote Ubuntu server through SSH and Nano. I've tried using Vim and Emacs but since I don't manage the server frequently enough I never quite get the hang of it and end up forgetting the commands.
I use TextMate daily for programming and was wondering if there's any counter-recommendation against mounting the server's /etc/ folder locally using http://www.macfusionapp.org/ and creating a TextMate project containing /etc/ and editing all configuration files right within?
root would have to be used through SSH to allow editing of the /etc/ files so that makes me a little nervous. Is this a bad approach?

I sometimes use Cyberduck to remotely edit files. You can set up SFTP connections in Cyberduck, so you can connect to any remote machine to which you have SSH access. Cyberduck lets you use TextMate as an external editor, so you can set up the connection and start editing, and Cyberduck will automatically upload your changes.
(This is probably possible in other FTP clients like Transmission, too, but I personally use Cyberduck so I don't know much about other clients.)
There's nothing wrong with using MacFUSE, but I find the Cyberduck solution to be simpler.

Related

Is there an efficient way to do remote editing over server using sublime Text 3?

I am writing some projects and need frequently compile and test on remote machine.
I am not a vim user thou :(
What I end up now is to use Fetch to browse the project folder and directly open those file using sublime by changing the default editor in Fetch. It somehow works, but one thing not perfect is that I cannot have a “project” structure in my sublime.
I am wondering anyone has a better way to use Terminal (or iTerm whatsoever) with sublime better.
Although this question is over two years old, I will try to answer it. Maybe it will be helpful for you or others that find it.
First, there is sshfs, which you can install via Homebrew or MacPorts. A simple approach would be as following:
mkdir -p ~/mnt/server
sshfs user#server.example.com:/path/on/server ~/mnt/server
Afterwards, you have the complete folder structure from server.example.com locally available at ~/mnt/server. Make sure you set up SSH keys to avoid entering the user password every time. You can find tutorials on that everywhere on the net.
For servers that only offer FTP access (shared hosting and the like), you can use curlftpfs in the same fashion.
To close the connection, simply unmount:
umount ~/mnt
For a GUI-based approach, you have several options. There is Transmit, which features mounting connections as volumes, Forklift which is a Finder replacement that can do the same, ExpanDrive and my favorite Mountain Duck.
If you plan to move lots of data, especially a lot of small files, Mountain Duck performs the best in my testing.
You could use TransmitFTP. Any FTP/SFTP/WebDAV/S3 server connection can be mounted as a volume, e.g., /Volumes/Example. Then you can browse to it when opening a folder in SB and add to your project like any other directory on your filesystem.

Textmate question: how to have a drawer when editing files online?

is it possible with Textmate to work remotely and using the sidebar drawer?
thanks
How do you do the "remote" part of your question? SSHFS? FTP?
If you use FTP (Transmit or Cyberduck) there is at least one way but I think it's extremelly convoluted. I used to want it badly when I started to use TextMate but I soon learned about Subversion and then Git and now, I almost never use an FTP client for development work at all.
Both versioning systems are extremelly well integrated with TextMate and the whole concept of working on a local copy and pushing only valid changes is vastly superior to using an FTP client to download a whole file in a temp folder, opening it with a local editor, saving the temp file, uploading it to the server.
If you use SSHFS or some other ways to mount the remote server you can use it as you were working with local file with the caveat that the whole thing can be maddening slow.
Did you try to edit the files within an SSH session in the terminal? Using Vim like that is actually very fast but it can lead to somewhat unpleasing situations when not done correctly.
I found myself:
Use Transmit 4+
Mount the server as image
drag the entire mount icon in textmate
done.

Working with a slow connection

I'm working with Textmate and Transmit.
I work locally and sync with the server every now and then.
At the moment I'm doing this by myself, it's slow and takes some time.
What are the best ways to sync between servers?
Also, is it possible to archive the directory and unpack it at the server? This would be so much faster...
Thanks!
What are the best ways to sync between
servers?
rsync? It's pretty much designed to do that exact task (syncing changes between files) and comes standard on most *nix OSes (including Mac OS X).
If you have, or could obtain, ssh access you could use something like SSHFS with MacFUSE
This would let you remote mount the server filesystem though Finder, as if it were local, but only using a ssh secure shell remote login.
Option 1
rsync --help
Option 2
Get an editor which is able to work with remote files.
Option 3
Mount remote directory and use your favorite editor.
Yummy FTP is for Mac and much faster than Transmit. It's the best you can get if you have only a FTP connection.

What tools do you use to upload files to amazon ec2 Linux instances?

I am using the standard fedora AMI with the LAMP stack bundled and I want to upload files onto the server from my Windows desktop.
What is the "normal" approach for this? I am not a UNIX admin by any stretch, although I am more than comfortable with FTP and the basics of a BASH shell.
As far as I can see there is no FTP server installed by default on the remote virtual machine, and I am unable to open one up at my end because of firewall restrictions. I looked at WinSCP, but before I go to the lengths of installing and configuring that I wondered what the expected means of doing this might be. In any case I don't see how WinSCP or any other FTP based tool can work without the target machine listening, which implies something like and FTP server.
Is there anything like a Windows remote desktop connection?
I could mount an S3 elastic storage volume from within EC2, but it is a bit of a sledgehammer to crack my little nut of just wanting 100k of files copied up to the server.
This is a different question to getting my web application running on the virtual server to save files locally, which is what the other SO questions in a similar vein seem to be asking.
Any ideas welcome.
I use putty's psftp, which uses ssh. If you can ssh into the box, then psftp should work.
http://www.chiark.greenend.org.uk/~sgtatham/putty/
You will first need to convert your pem private key to a ppk using puttygen for psftp to use the keyfile for authentication because it only uses ppk format and not pem format, as far as I know.
You've made the right choice with WinSCP. SCP is based on SSH, not FTP, and SSH and SCP are standard on Linux servers. So, WinSCP takes a bit of configuration bit its the simplest. Your alternative would be to install and maintain and FTP server - a lot more work there! There are equivalents to Remote Desktop but they're way more complicated to setup.
If you're having trouble with configuring your SCP program with your key but you have the ability to "shell" in, you could create a new linux user on the server with a password, then you can use that password instead of the key in WinSCP which is easier.
"In any case I don't see how WinSCP or any other FTP based tool..."
SCP (and SFTP, for that matter) is an entirely different protocol from FTP. Data is transferred over an SSH channel. If you have SSH access to your virtual machine, SCP/SFTP should work.
If you prefer a graphical tool, have a look at the S3Fox Firefox plugin (my choice), or peruse this list of standalone graphical S3 browsers.
For S3 I use Cyberduck (on Mac) and S3Fox. For mass uploads (in scripts) I use s3sync. I manage EC2 Instances with ElasticFox and original ec2 Tools from Amazon.

Mac Text Editor that Support SSH Keys

I have a workmate who only uses a Mac. Being unfamiliar with Mac text editors, I'm wondering if anyone can recommend one that will allow SFTP access using ssh keys (not just passwords).
I would recommend checking out MacFUSE and MacFusion which will allow your workmate to mount ssh shares as native partitions, allowing them to use whatever editor they wish.
(source: googlecode.com)
They would probably use the included OpenSSH libraries. So you would just need to add the public/private keys in ~/.ssh/
I personally use rsync to synchronize the working set and the remote directory. Write a small batch file, double click and it synchronizes within a few milliseconds. If you don't need concurrent editing then this will probably be the more sane solution as you don't need to worry about slow filesystem abstraction layers. MacFuse is great in theory, but I have had it lock up finder a bit too often for my liking.
.... not sure, but I'd investigate BBEdit
Cyberduck and TextMate integrate very well - Cyberduck lets you use SFTP, and TextMate is one of the best Mac editors around.
Cyberduck has integration support for many editors.
http://cyberduck.ch/
With it you can browse (edit) FTP, SFTP, WebDAV, Cloud Files and Amazon S3.

Resources