Christian Weigel – WebIngenieur

… in pursuit of global and personal happiness

Archive for the ‘Uncategorized’ Category

Following the installation instructions on the OpenVAS site I stumbled upon some problems importing the required Public Key.

The pgp.net keyservers seem to be not really reliably these so I was unable to use them to retrieve the required Public key for validating the repositories’ packages.

this resulted in the following error:

Reading package lists… Done W: GPG error: http://download.opensuse.org ./ Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY BED1E87979EAFD54 W: You may want to run apt-get update to correct these problems

to resolve this problem just download the key directly  from the repository

wget http://download.opensuse.org/repositories/security:/
OpenVAS:/STABLE:/v4/Debian_5.0/Release.key

and import the key manually

apt-key adv –import Release.key

update your package lists

apt-get update

and it should work without problems.

If your AWS resources are spread across multiple Regions, there is a simple trick to save you adding the –region=REGION parameter after each time your are issuing AWS EC2 API commands.

store your settings in a file e.g. ~/.ec2/eu-settings

export EC2_URL=https://ec2.eu-west-1.amazonaws.com
export EC2_REGION=eu-west-1

and e.g. ~/.ec2/us-settings

export EC2_URL=https://ec2.us-east-1.amazonaws.com
export EC2_REGION=us-east-1

now we define two simple aliases as shortcuts to these settings.

# alias eu=’source ~/.ec2/eu-settings’
# alias us=’source ~/.ec2/us-settings’

calling ‘eu’ or ‘us’ from shell will now switch the regions for you.

you may check that it worked by typing env and noting the values for EC2_URL and EC2_REGION.

These two aliases will – for now – only work in your current login session. To persist the setting, just do the following…

Persisting the aliases in /etc/bash.bashrc

edit /etc/bash.bashrc (in debian – this might differ a bit in other linux distributions)

# vi /etc/bash.bashrc

add

alias eu=’source ~/.ec2/eu-settings’
alias us=’source ~/.ec2/us-settings’

below anything that is written there. And call

# source /etc/bash.bashrc

The aliases should work as previously, but will now be available after a system restart or new login to your machine.

Check again using env if you want to verify everything worked correctly.

Inspiration taken from: http://learninginlinux.blogspot.com/2007/02/setting-environment-variables-through.html