How to access Linux ssh servers password-less in Linux
If you happened to run Linux and have multiple linux servers, here’s a short how to access them password-less.
- First we need to generate some keys:
ssh-keygen -t dsa - Then we copy them over to the remote server:
scp .ssh/id_dsa.pub user@someserver:/somepath - Then we copy the key to the authorized_keys file:
cat id_dsa.pub >> .ssh/authorized_keys - Then as a security measure we chmod it:
chmod 644 .ssh/authorized_keys - Logout and try login in again. Hurra!
Password-less ssh logins are done via keychain. Here’s a small excerpt from the Gentoo Wiki:
Many of us use the excellent OpenSSH as a secure, encrypted replacement for the venerable telnet and rsh commands. One of OpenSSH’s (and the commercial SSH2’s) intriguing features is its ability to authenticate users using the RSA and DSA authentication protocols, which are based upon a pair of complementary numerical “keys”. And one of the main appeals of RSA and DSA authentication is the promise of being able to establish connections to remote systems without supplying a password. The keychain script makes handling RSA and DSA keys both convenient and secure. It acts as a front-end to ssh-agent, allowing you to easily have one long-running ssh-agent process per system, rather than per login session. This dramatically reduces the number of times you need to enter your passphrase from once per new login session to once every time your local machine is rebooted.
Amazon EC2, Cloud Computing Getting Started
Amazon has this services where you can use virtual servers, either your custom or prebuilt publicly shared server images. The key point here is that Amazon has a lot of servers that can be used at any time.
So let’s get started. The first thing to do is sign up at Amazon EC2. I’ll be using Ubuntu on this.
You need Java JRE, do:
apt-get install sun-java5-jre
vim .bashrc
# Amazon Ec2
export EC2_HOME=~/.ec2
export PATH=$PATH:$EC2_HOME/bin
export EC2_PRIVATE_KEY=~/.ec2/pk-VGKIRWAKVSIEXEPVFQ2NSVQ4APUMYAC3.pem
export EC2_CERT=~/.ec2/cert-VGKIRWAKVSIEXEPVFQ2NSVQ4APUMYAC3.pem
export JAVA_HOME=/usr
type bash to reload your bash_rc
cd ~/.ec2
Amazon has this services where you can use virtual servers, either your custom or prebuilt publicly shared server images. The key point here is that Amazon has a lot of servers that can be used at any time.
So let’s get started. The first thing to do is sign up at Amazon EC2. I’ll be using Ubuntu on this.
You need Java JRE, do:
apt-get install sun-java5-jre
vim .bashrc
# Amazon Ec2
export EC2_HOME=~/.ec2
export PATH=$PATH:$EC2_HOME/bin
export EC2_PRIVATE_KEY=~/.ec2/pk-VGKIRWAKVSIEXEPVFQ2NSVQ4APUMYAC3.pem
export EC2_CERT=~/.ec2/cert-VGKIRWAKVSIEXEPVFQ2NSVQ4APUMYAC3.pem
export JAVA_HOME=/usr
type bash to reload your bash_rc
cd ~/.ec2
Amazon has this services where you can use virtual servers, either your custom or prebuilt publicly shared server images. The key point here is that Amazon has a lot of servers that can be used at any time.
So let’s get started. The first thing to do is sign up at Amazon EC2. I’ll be using Ubuntu on this.
You need Java JRE, do:
apt-get install sun-java5-jre
vim .bashrc
# Amazon Ec2
export EC2_HOME=~/.ec2
export PATH=$PATH:$EC2_HOME/bin
export EC2_PRIVATE_KEY=~/.ec2/pk-VGKIRWAKVSIEXEPVFQ2NSVQ4APUMYAC3.pem
export EC2_CERT=~/.ec2/cert-VGKIRWAKVSIEXEPVFQ2NSVQ4APUMYAC3.pem
export JAVA_HOME=/usr
type bash to reload your bash_rc
cd ~/.ec2
ec2-add-keypair arstan-keypair

Save those lines including —–BEGIN RSA PRIVATE KEY—– and also —–END RSA PRIVATE KEY—– lines.
sudo chmod 600 id_rsa-arstan-keypair
ec2-describe-images -o amazon This will show the server images that Amazon has for you. You can see ec2-describe-images -a to see all the server images you have access to.
ec2-run-instances ami-0459bc6d -k arstan-keypair
ec2-describe-instances will show you instances you are running.
How to install and run Ubuntu 8.04.1 Server in VirtualBox
It’s been long time since I posted in my blog. It’s past midnight Wednesday (I love Selangor state for its public holidays!) and no office tomorrow.
I watched closely VirtualBox from its Sun acquisition and I am very pleased with the project progress overall. On my day to day RnD stuff I have already shifted myself from VMWare Sever to VirtualBox.
In VirtualBox after installing Ubuntu 8.04.1 Server (Hardy) and rebooting, you will get some errors that your CPU is not supported.
It’s because you have no linux-virtual package installed. So here’s the steps how to pass by this problem.
- Reboot the instance, boot into Rescue a broken system
- If you chose auto-partitioning, select sda1 as your root directory and enter into it.
- Execute dhclient eth0, apt-get update && apt-get install linux-virtual
- Type exit and reboot the system from the menu.
Now you will be able to boot into your newly installed Ubuntu.
How to change network interface names in Ubuntu
Have you ever found out that your eth0 interface suddenly became eth1 or sth like that? I noticed that after some minor upgrades my eth0 became eth1. I hate this, because I am so used to eth0 as my LAN interface.
Also in latest versions of Ubuntu my WLAN is taken as wlan0. I’m so much used to eth1 as my WLAN. Anyways, on my laptop I won’t have any additional LAN devices except my built in.
So, let’s change those things, shall we?
sudo vim /etc/udev/rules.d/70-persistent-net.rules
# PCI device 0×14e4:0×1600 (tg3)
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:xx:xx:xx:xx:xx”, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth1″# PCI device 0×8086:0×4222 (iwl3945)
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:xx:xx:xx:xx:xx”, ATTR{type}==”1″, KERNEL==”wlan*”, NAME=”wlan0″
Change above to:
# PCI device 0×14e4:0×1600 (tg3)
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:xx:xx:xx:xx:xx”, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth0″# PCI device 0×8086:0×4222 (iwl3945)
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:xx:xx:xx:xx:xx”, ATTR{type}==”1″, KERNEL==”wlan*”, NAME=”eth1″
So, all you have to do is to edit /etc/udev/rules.d/70-persistent-net.rules file and change the NAME option to your choice of your ethernet/wifi device name.
See bugs from Ubuntu Launchpad here and here.
History of my bash commands
?arstan@blacky:~$ history | awk ‘{a[$2]++ } END{for(i in a){print a[i] ” ” i}}’|sort -rn|head
40 ssh
38 ping
35 su
23 sudo
22 ls
18 vlc
12 cd
10 ifconfig
10 cat
9 axel
This is my daily work laptop. Running xubuntu 8.0.4.1
What’s yours?

