Thursday, June 10, 2010

Setting up SSH Agent and solving agent issues when prompting for rsa password

Setting up SSH-Agent
1. Generate your key
ssh-keygen -t rsa
2. Copy the public key to the authorized_keys file
cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
3. Copy the public key to the remote hosts
scp ~/.ssh/id_rsa.pub seasnake.techops.uk.betfair:~/.ssh/authorized_keys

If you are prompted for your id_rsa passkey do the following;
If using a windowing environment you may have set ssh-agent running in one window, therefore your SSH_AUTH_SOCK variable needs to be set in the other windows;
1. In the window that allows you to ssh without specifying a password of any kind type;
echo $SSH_AUTH_SOCK
2. Using the value returned, in the other terminal windows type;
SSH_AUTH_SOCK=

If you can't connect without a password on any terminals do the following;
1. Find the current ssh agent
ps -ef | grep ssh
2. kill the ssh-agent process
kill
3. Start a new ssh-agent process and set the shell variables
eval `ssh-agent`
4. Check that your SSH_AUTH_SOCK is set
echo $SSH_AUTH_SOCK
5. Now add your key to the agent
ssh-add
6. Enter your id_rsa password when prompted
7. Log on to your remote system without the password.

Saturday, June 5, 2010

Cool Fedora core tripwire setup page

http://www.syntaxtechnology.com/2009/07/install-tripwire-on-fedora-11/
and
http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/ref-guide/ch-tripwire.html

Although the version that installs with FC12 you only need do the following steps;
$> tripwire-setup-keyfiles
Follow the instructions, which mainly require 2 passwords, 1 for site and 1 for local
Once this step is completed you simply run;
$> tripwire --init
And wait for it to complete

Updates can be done by first dumping the policy file;
$> twadmin --print-polfile >my.pol

And then editing this file accordingly. Once you have completed your edits you would then need to encrypt the file for the init process to be able to use it. This will generate the tw.pol file;
$> /usr/sbin/twadmin --create-polfile -S site.key /etc/tripwire/my.pol

You will be prompted for your site password

To load the policy into the tripwire database;
$> rm /var/lib/tripwire/hostname.localdomain.twd

Run the following to regenerate the database;
$> tripwire --init

Test if your email account will work;
$> tripwire --test --email username

View reports;
$> /usr/sbin/twprint -m r --twrfile /var/lib/tripwire/report/.twr

Update database;
$> /usr/sbin/tripwire --update --twrfile /var/lib/tripwire/report/.twr

Monday, May 10, 2010

Linux Stuff

Timezone settings for CentOS/RedHat

/etc/localtime is the file that deals with time zones.

Files in /usr/share/zoneinfo are what can be used to change these times.

So if your system was installed using BST and you want UTC do the following;

mv /etc/localtime /etc/bst-localtime

ln -s /usr/share/zoneinfo/UTC localtime

Tuesday, April 13, 2010

First accessories for the iPad

You heard it here first, so it's my copyright April 2010.

The new iPad from Apple needs some accessories, so here are 2. Watch this space for the design. But here is the concept and if anyone comes up with them then they will have to owe me.

iWings
This is a protective case for the iPad which protects the screen with door style flaps which fold back to look like wings (think time of the month, lilettes). The flaps will naturally fold back to ensure the screen is protected at all times, but allow you to hold your iPad like a book.

The Clamp-On
A clamp that allows you to hold the iWings round the back of the iPad, and will stand your iPad at a convenient angle on a desk to allow you to read it hands free.

Remember you heard it here first.