chris-l2
2/11/2016 - 10:52 PM

Terminal Setup

Terminal Setup

Terminal Setup

This is my setup for Apple's OS X Terminal Application.

Oh-My-ZSH

A better terminal.

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Then update ~/.zshrc to include:

PLUGINS

plugins=(git sublime osx brew rails)

THEME

I prefer the Agnoster theme.

ZSH_THEME="agnoster"

It requires installing Powerline Patch Fonts by running install.sh

It depends on the screen, but for non-retina displays I'm enjoying Roboto Mono Light for Powerline.

COLOURS

git clone git://github.com/altercation/solarized.git

Instructions are in the readme.

SSH Keys

On the server that will be connecting to the remote server:

copy paste the following two commands, one at a time:

ssh-keygen -t rsa;cat ~/.ssh/id_rsa.pub > ~/authorized_keys_$(hostname)

Then transfer the file to the remote computer:

sftp username@remoteserver.com

put authorized*

exit

Then log into remote server: ssh username@remoteserver.com

Then append it to ~/.ssh/authorized_keys on the server(s) you're connecting to:

cat ~/authorized_keys_* >> ~/.ssh/authorized_keys

Note: Permission may need to be 700 on the directory and 600 on the file.

SSH Config

If you have many ssh servers to connect to, it may be beneficial to set up a config file in your ~/.ssh directory.

It is extremely helpful to me because I have many servers that have different ports. The config file removes the need to remember the port numbers for each specific ssh server. It also allows me to specify which ssh key I use, so I can have a personal key and a work key. Also you can add nicknames to each server.

Here is an example:

Host home User rubbs Hostname yourhostnameoripaddress IdentityFile ~/.ssh/personal_rsa Port 2222 ForwardX11 Yes LocalForward 5900:localhost:5900

In order to connect to that server I just type: ssh home. It will even tab complete!