WELCOME!

What is Pinoy? It's a slang for Filipino, a person who comes from the Republic of the Philippines, or commonly known as the Philippine Islands (PI). I am a Filipino and works as an Oracle DBA in the United States. Whenever an issue arises or just for experiments, I usually forget what I did to solve/conduct them. There must be a central location where I can put everything. Thus, this blog was born. It's a collection of ideas, tips and tricks, scripts, or anything interesting that happened to me on an Oracle database or any other stuff.

The simpler, the better! has always been my motto. You don't have to complicate things. Simple things, for me, is always easier, just like my site.

FYI, anything that is written here is based on my personal experiences and is not endorsed by any other party. Also, I will not be held liable for issues that can arise by following whatever I did. Just like any other good DBA would say... ALWAYS TEST!

Hope you can find this site helpful in whatever you need and remember, I am not a guru.

Dec 13, 2011

Linux: Generating SSH Keys

One of my colleagues asked if there's a way to log into a remote machine using SSH without a prompting for a password. A script was being written to check the load remotely. I told him to generate SSH keys for the user that will be running the command and copy that key to the other machine. For example, I have to machines and I want them to be cross checking each other (for some reason). Let's call them Server01 and Server 02.

First generate an ssh key on each machine and copy that to the other machine. I ran the following on both of them:
Linux> ssh-keygen -t rsa
  Linux> ssh-copy-id -i ~/.ssh/id_rsa.pub userName@server0x

I then tried to do a remote login from server01 to server02. However, it is still prompting me for the password. It seems that "password-less login" is not working. The permissions for the .ssh directory and authorized_keys file is 700 and 600, respectively. These are the correct permissions.

Further investigation revealed that the home directory of the user that I use to generate the keys should have a drwxr-xr-x permission. Thus, after changing the attributes of the directory using
  Linux> chmod 755 /path/to/home/directory
I was able to log in remotely without the password being asked.

1 comment: