Archive

Archive for the ‘security’ Category

Password-less Logins with OpenSSH, scp, and rsync

January 29th, 2010 3 comments

Setting up password-less logins is both dangerous, and mighty. It allows one to authenticate to an OpenSSH server without typing in a password. Authentication is gained via knowledge of a private key.

Generate a Public/Private Key Pair

$> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/felipe/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): <ENTER>
Enter same passphrase again: <ENTER>
Your identification has been saved in /home/felipe/.ssh/id_rsa.
Your public key has been saved in /home/felipe/.ssh/id_rsa.pub.
The key fingerprint is:
d7:79:c3:01:ce:90:71:a2:a2:3d:83:26:fb:9a:1f:5b felipe@linux.local

You will then find two files inside your directory. Keep them safe, secure, and secret. The public key (the one with .pub at the end) can be widely disemmindated. It represents the antonym of secrecy and privacy. The private key, however, must remain private and secret at all times.

Copy the PUBLIC key to a remote OpenSSH server

You must copy your public key to a remote host. The host will verify that you own the private key by encrypting a “challenge” and forcing your ssh client to decrypt it. If successful, you are authenticated, and admitted entrance. A password isn’t required.

$> cat /home/felipe/.ssh/id_rsa.pub | ssh felipe@remote-host.com "cat - > .ssh/authorized_keys"
felipe@remote-host.com's password: <PASSWORD>

This copies your public key the authorized_keys file (NB: authorized_keys2 is deprecated and no longer recommended for use. OpenSSH checks both).

Testing Phase

‘logout’ or ‘exit’ and try:

$> ssh felipe@remote-host.com

It should not ask you for a password. You should automatically be logged into the remote system.

Works with scp and rsync too!

’scp’ and ‘rsync’ both use a ssh client at the backend, and so will also authenticate automatically utilising your public and private key pair. Try:

$> scp file_a felipe@remote-host.com:file_b

This should transfer without pausing to ask for your password. Likewise try:

$> rsync -r /backups/2010/Jan felipe@remote-host.com:/backups/2010

This should backup your entire directory to remote-host.com without pausing to ask for a password. You can put a line similar to this one in a shell script, and run it with cron once a week or so. It will automatically backup your system, using OpenSSH, and proven secure and safe method for authentication of human and machines across an untrusted public network, away from curious eyes.

Crackers infiltrate US Army Servers

May 29th, 2009 No comments

army-logo

The hacks are troubling in that they appear to have rendered useless supposedly sophisticated Defense Department tools and procedures designed to prevent such breaches. The department and its branches spend millions of dollars each year on pricey security and antivirus software and employ legions of experts to deploy and manage the tools.

[...]

Equally troubling is the fact that the hacks appear to have originated outside the United States. Turkey is known to harbor significant elements of the al-Qaida network. It was not clear if “m0sted” has links to the terrorist group.

Idiot newspaper.

Categories: security Tags: ,

Setting up IMAP with KMail in Linux to get e-mail from QUT

March 10th, 2009 No comments

These instructions are for QUT students. I do not know if they will work for QUT staff. Use at your own risk.

You need ‘vpnc’ program (install it with your pkg mgr). Then download off-campus.conf file and save it to /etc/vpnc/ directory. You could name it default.conf if it will be your only vpnc connection. The contents should begin with at least:

IPSec gateway sas.qut.edu.au
IPSec ID qut
IPSec secret qutaccess

As root run vpnc off-campus of just vpnc if you renamed it to default.conf. Enter username/password when prompted.

In Kmail, you setup IMAP connection using SSL, username/password and port 993 to host mail.qut.edu.au. SMTP uses NO ecryption, but authentication method is LOGIN (not PLAIN) and port 25 on host mail.qut.edu.au.

To exit vpnc type vpnc-disconnect as root.

I hope this helps someone.

References
http://www.its.qut.edu.au/offcampusaccess/sas/linux.jsp

Categories: computers, security Tags: , , , ,
. .