Archive for the 'Security' Category

SSH SOCKS proxy server

Jan 04 2011 Published by under Security,Shell

If you crave for privacy and wish to protect your communications (like chat and email) from prying eyes, this is how dynamic port forwarding can turn SSH into a SOCKS proxy server.

The idea is to forward all traffic from @unsecure to @secure location via SSH and then use Internet from @secure location.

To set up a proxy run

ssh -C -D 1080 user@SecureLocation.com

-C enables compression
-D 1080 runs dynamic port forwarding on port 1080

After you connect to secure location, edit browser, email or chat SOCKS proxy settings, pointing them to ‘localhost:1080‘ and use your apps without worrying of being snooped.

Comments Off

Rsync using SSH RSA auth key

Sep 23 2009 Published by under Security

rsynclogo

How to rsync files between two servers when remote server uses an RSA key for authentication.

Format:
rsync $options $host:$from $to

rsync -avz -e "ssh -i key.rsa" \
user@domain.com:/var/www /var/www/backup

The ‘-avz’ options are used for creating archive, being verbose and compressing the file transfer.

‘-e “$command”‘ specifies the shell command to use; in this case calling the SSH RSA key used for authentication

Comments Off

Sharing GPG keys between computers

Mar 02 2009 Published by under Security,Ubuntu

GnuPG

Until recently there was no reason for me to share my personal encryption keys between multiple computers. So, naturally, I got stuck when I tried to import keys I use at work to my home computer.

I use GnuPG http://www.gnupg.org/ for signing my emails. GnuPG can be used for encryption as well but I do not use this feature that much. When signing emails, I tend to create a key for every email account that I have. It is just a silly rule that I have :)

So, this is the procedure to create and copy encryption keys from one computer to another.

Start key generation and set encryption details:

$ gpg --gen-key
1
4096
0
y

Set personal details such as name, email address, comment and key password:

Haris
email@domain.com
comment goes here
o

To list generated keys, type:

$ gpg --list-keys

Now, export secret and public keys into human readable files:

$ gpg --export-secret-keys -a -o private.key "Haris "
$ gpg --export -a -o public.key "Haris "

These two keys can now be copied to another computer and imported there:

$ gpg --import private.key
$ gpg --import public.key

After the import you have to set the trust level for the key:

$ gpg --edit-key "Haris "
trust
5
quit

If for any reason you need to delete your keys do this:

$ gpg --delete-secret-keys "Haris "
$ gpg --delete-keys "Haris "

Comments Off

Performance Optimization WordPress Plugins by W3 EDGE