Of course, you can choose whatever alias name you like. Add the following to your local ~/.bash_profile: alias open-tunnel='ssh -f -N -R 10022:localhost:22 ' To make the command easier on yourself, you can add an alias in your bash profile. You'll need to run that once after you log in. Replace the brackets with your username and machine name. I chose 10022 because it's similar to ssh's default port of 22. The remote port can be anything you want, but you should choose a port > 1024 to avoid conflicts and so you don't have to be root. Anything contacting the remote machine on port 10022 will be sent to port 22 on your local computer. The -R flag binds a port on the remote computer to a port on your local computer. The -f and -N flags put ssh into the background and leave you on your machine. To set up the ssh tunnel, you need to run a command on your local machine like: ssh -f -N -R 10022:localhost:22 You need to be able to ssh from local to remote to run the commands, and you need to be able to ssh from remote to local so it can send commands to TextWrangler. Set up ssh keys so you don't have to enter your password every time (optional).Set up an alias for TextWrangler on the remote machine (optional).Set up an alias for the ssh tunnel (optional). Set up an ssh tunnel from the remote machine to your machine (required).Enable ssh login on both computers (required).There's 2 required and 3 optional parts to this: I was actually looking to do the same thing, and no one had written it up, so I figured this out today.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |