Writing by shivdev on Friday, 18 of May , 2012 at 5:25 pm
The below example will demonstrate how shivdev@sk-optiplex can SSH to shivdev@sk-redhat without a password. The idea is to create SSH (public/private) keys on sk-optiplex and then copy the public key /home/shivdev/.ssh/id_dsa.pub from sk-optiplex over to sk-redhat as ./ssh/authorized_keys2.
I’m using SSH 2 with DSA encryption, because I just couldn’t get SSH with RSA encryption to work.
shivdev@sk-optiplex:~$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/shivdev/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/shivdev/.ssh/id_dsa.
Your public key has been saved in /home/shivdev/.ssh/id_dsa.pub.
The key fingerprint is:
73:4a:b1:d3:d6:3c:fc:ed:c7:c6:61:18:0f:fb:06:6b shivdev@sk-optiplex
The key’s randomart image is:
+–[ DSA 1024]—-+
| |
| |
| . |
| + + o |
| S + = * |
| . * * = |
| . *oo|
| E +=|
| . ..o|
+—————–+
shivdev@sk-optiplex:~$ scp /home/shivdev/.ssh/id_dsa.pub shivdev@sk-redhat:.ssh/authorized_keys2
The authenticity of host ‘sk-redhat (sk-redhat)’ can’t be established.
RSA key fingerprint is b4:3a:15:5d:cb:5d:7e:05:39:35:0d:9c:1f:d4:84:08.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/home/shivdev/.ssh/known_hosts).
shivdev@sk-redhat’s password:
id_dsa.pub 100% 610 0.6KB/s 00:00
shivdev@sk-optiplex:~$ ssh shivdev@sk-redhat
The authenticity of host ‘sk-redhat (sk-redhat)’ can’t be established.
RSA key fingerprint is b4:3a:15:5d:cb:5d:7e:05:39:35:0d:9c:1f:d4:84:08.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/home/shivdev/.ssh/known_hosts).
Last login: Thu May 17 14:48:01 2012 from 10.4.21.184
[shivdev@sk-redhat ~]$
As you can see after copying over the public key from shivdev@sk-optiplex:.ssh/id_dsa.pub over to shivdev@sk-redhat:.ssh/authorized_keys2, shivdev@sk-optiplex is able to SSH into shivdev@sk-redhat without a password.
Category: Linux,Tips and Tricks
Writing by shivdev on Monday, 23 of April , 2012 at 12:37 pm
I would definitely recommend it for those who want to set foot in China and get a feel of the city’s hustle and bustle and enjoy some great local food.
I had a 15 hour halt in Hong Kong and didn’t really plan anything, and thought I’d take a tour, but then I decided against it since I just wanted to do get a feel of the city like the locals. First Impression – New York City, but with Chinese people! Not everyone speaks English – so don’t believe what you read elsewhere. You might have to talk to the friendly Europeans there. Very few locals spoke English. It’s pretty safe, so no worries.
So, once you get to Hong Kong, just do your immigration. They are smart they don’t usually charge for Visas. They know you will spend in Hong Kong. I got a 14 day Free Visa. Just amazing!
You can take a guided tour or just explore the islands yourself.
Get the MTR Tourist Day Pass $55 HKD (You will need to get a connection from Airport to Tsing Yi for about $60 HKD return trip)
It’s pretty easy to navigate and here’s something that I did and would recommend (in this order to save time):
- You definitely want to go to TST (Tsim Sha Tsui) on the MTR and take the Avenue of the Stars Exit for a spectacular view
- Take the $2.50 HKD Ferry (Yes – Real Cheap) to Hong Kong Central
- Explore Central Area
- Take a cab to Victoria Peak Station, then take the tram up to Victoria Peak
- Come back down, and take Bus 15C back to Central MTR
- Go to Wan Chai Computer Center if you’re into gadgets etc. – just outside Wan Chai MTR
- Or perhaps shopping at Times Square at Causeway Bay MTR
- Add other stops if time permits
Eat at any of the several restaurants on the way and then head back over the airport in time to catch your flight. All in all, a Great city, Fantastic super-clean MTR and local transporation, friendly people, great food and yes – a concrete jungle! You will be amazed if you’re into skyscrapers.
Category: Travel
Writing by shivdev on Friday, 17 of February , 2012 at 1:50 am
TWO WEEKS IN HELL (available on NetFlix Streaming) is a fantastic documentary that takes candidates’ physical and mental fortitude to the limit. It is not Reality TV. This is a serious documentary that gets you intrigued right from the get go. Candidates start quitting from the Hour 1! The content is pretty graphic, but it’s the truth. The would-be Green Berets need to prove they can emerge victorious in uncharted hostile environments and in addition to being extremely innovative they must prove above all that they can follow instructions and will not risk their operations. They must demonstrate their sincerity in working with a team. The Special Forces and Selection (SFAS) will use all the latest technology and gadgets to observe the candidates over the two week period, and then evaluate if they have what it takes.
I had no idea what Green Berets needed to go through until I watched the two series documentary. Just Amazing! Must watch!
Category: Reviews
Writing by shivdev on Tuesday, 14 of February , 2012 at 10:16 pm
Make sure you have modified your /etc/hosts file
$ sudo vi /etc/hosts
# Assuming DHCP that my machine pulls 10.4.11.11. and hostname is wimbledon
10.4.11.11 wimbledon
Category: Uncategorized
Writing by shivdev on Tuesday, 14 of February , 2012 at 10:13 pm
So if you’ve stumbled here, you’ll know that things are never simple with Linux. You probably chose Minimal or Desktop install during your OS installation and now need to install all the crap that gives you dependency nightmares.
yum groupinstall development-tools
yum install zlib-devel
Refer to some good articles from nixCraft CentOS Linux Install Core Development Tools Automake, Gcc (C/C++), Perl, Python & Debuggers and CentOS Linux Install zlib-devel RPM Package
Make sure you’re able to install RPMs from your CDROM by adding it to yum.repos
Category: Linux
Writing by shivdev on Friday, 10 of February , 2012 at 12:59 am
RHEL can be such a pain! I installed RHEL 6.1 and there was no gcc on there!?! Now for whatever reason I needed it and it wasn’t able to get yum install gcc to work. I’m not surprised at all – RHEL/CentOS are well known for being tortuous!
So now I needed to install the gcc* rpm from the CDROM and again I run into dependency hell. No big deal – it’s a well known RHEL problem.
Fortunately, I found Adding cdrom to yum as repo which partially rescued me. Next, I ran into Public key for kernel-headers-2.6.32-131.0.15.el6.x86_64.rpm is not installed and followed this link to get me going.
Step 1: Mount your CDROM to /mnt/cdrom
$ mount /dev/cdrom /mnt/cdrom (For Example)
Step 2: Add the CDROM to your yum.repos (Tell yum to look at the CDROM as well while installing packages)
$ vi /etc/yum.repos.d
Step 3: Paste the following
[local]
name=Local CD Repo
baseurl=file:///mnt/cdrom
Step 4: Tell yum to ignore any gpg key checking
$ vi /etc/yum.conf
Change gpgcheck=1 to gpgcheck=0
Step 5: Run the yum install and if found on the CDROM it’ll install it for you
$ yum install gcc (in my case)
Category: Linux,Tips and Tricks