Thursday, December 22, 2011

Linux Setup

These are some commands and setting to run when setting up an Linux box
Install GNOME
Ubuntu 11.10 installs with Unity - I'm still not a fan

sudo
apt-get install gnome-shell
Restart the machine and then select from the available X configurations - I like GNOME Classic

SSH Alias
Edit .bashrc to create SSH aliases for fast access to other Linux instances
alias servername='ssh domain\\username@servername.domain.com'
The name of the alias can be anything you like - if there are a lot of servers, the name of the server will probably work the best

source .bashrc to reload changes without a reboot

Create RSA Key Pair

Start in home directory
mkdir .ssh
chmod 700 .ssh
ssh-keygen -t rsa

I usually leave the passphrase blank because I guard my private key

Make backups of the key pair

Other options
-C "username@domain.com" - This will set the email address assigned to the public key, by default it will use the username and server name where it is being created
-D 4096 This creates a 4096 bit key, 2048 is set by default and strong enough in most situations

Add SSH Public Key to Server
Access your home directory on the Server
mkdir .ssh
vi .ssh/authorized_keys
Copy/paste the public key
chmod 600 .ssh/authorized_keys


No comments:

Post a Comment