ssh on davidchua https://dchua.com/tags/ssh/ Recent content in ssh on davidchua Hugo -- gohugo.io en-us Tue, 15 Jul 2014 00:00:00 +0000 X11 forwarding over remote SSH tmux https://dchua.com/posts/2014-07-15-x11-forwarding-over-remote-ssh-tmux/ Tue, 15 Jul 2014 00:00:00 +0000 https://dchua.com/posts/2014-07-15-x11-forwarding-over-remote-ssh-tmux/ I’m starting to do all my development remotely on a development server that I’m hosting at home over a VPN. This means that all my devices are basically thin-clients. Pre-requisite Make sure that you’ve already allowed X11 forwarding over your remote user account. If not, do this (in your remote server logged in as your remote user account) # in ~/.ssh/config (create if its not there) # add the following ForwardX11 yes One of the problems I had encountered was attempting to do X11 forwarding over TMUX. SSH Portforwarding https://dchua.com/posts/2014-03-08-ssh-portforwarding/ Sat, 08 Mar 2014 00:00:00 +0000 https://dchua.com/posts/2014-03-08-ssh-portforwarding/ When having a remote computer (A) in which you’re trying to access the port :3000, you can setup a reverse portforwarding with the following command: $ ssh -L <port that you want to access locally>:localhost:<port that you want to connect to> <user>@<ip> $ ssh -L 3000:localhost:3000 pi@myipaddress This way, you can access http://localhost:3000 and it is actually communicating with myipaddress:3000. All securely too! Properly using SSH Agent Forwarding in Capistrano https://dchua.com/posts/2013-08-29-properly-using-ssh-agent-forwarding-in-capistrano/ Thu, 29 Aug 2013 00:00:00 +0000 https://dchua.com/posts/2013-08-29-properly-using-ssh-agent-forwarding-in-capistrano/ You’ve probably seen this in your capistrano deploy script. # /config/deploy.rb set :ssh_options, { :forward_agent => true } SSH Agent Forwarding is a great way to keep SSH keys manageable as it allows the deployment server to use your own local private key to authenticate to the git repository, instead of having to give your deployment server access to your git repository. Github has an awesome article explaining this. My tl;dr version: Store your SSH private keys in a different file https://dchua.com/posts/2013-08-07-store-your-ssh-private-keys-in-a-different-file/ Wed, 07 Aug 2013 00:00:00 +0000 https://dchua.com/posts/2013-08-07-store-your-ssh-private-keys-in-a-different-file/ SSH Keys have been helping developers and system administrators quickly manage their servers without having to remember pesky passwords. I’d like to re-use my SSH key as I have multiple machines that I’d like to easily access my resources with. Normally, I would store my personal priv/pub SSH Keys on Dropbox (with encryption of course) and then copy it over to my new machine. But because I also keep different sets of keys around, I often found myself getting confused if this particular set of id_rsa/id_rsa.