SSH connection establisment.

Hi All,

I am trying to create an ssh connection between 2 servers.
Below are the steps which i have followed.

 
 
On server A::
 
ssh-keygen -t rsa
scp ~/.ssh/id_dsa.pub user@B:

Server B ::
cat id_dsa.pub >> ./.ssh/authorized_keys

But when i tried to connect through ssh i was prompted for password.
Please find my ssh version

OpenSSH_4.3p2, OpenSSL 0.9.8n 24 Mar 2010

Please correct me if there are any mistakes in my method.

You need to chmod 700 your ~/.ssh/ folders, and make sure your home-folders aren't world-readable, writable, executable. ssh will stop them from connecting if anything is wrong with these permissions.

I have changed the permissions of .ssh directory to 700 on both server A and server B. And even changed the permissions of authorized_keys to 700 on server B. But still not able to connect.

What are the permissions on your home directories?

Please find the list of files and directories in my home directory

$ cd $HOME
$ ls -lart
total 66
-rwxr-x---   1 u277084  fnusr        627 Jul 10 08:35 .profile
-rwxr-x---   1 u277084  fnusr        636 Jul 10 08:35 .login
-rwxr-x---   1 u277084  fnusr        362 Jul 10 08:35 .kshrc
-rwxr-x---   1 u277084  fnusr        591 Jul 10 08:35 .cshrc
-rwxrwxrwx   1 u277084  fnusr         88 Jul 18 03:08 a
-rw-r--r--   1 u277084  fnusr         10 Aug 26 08:59 s
--wxrwxrwx   1 u277084  fnusr         44 Aug 26 09:03 test
drwxr-xr-x  93 root     root          94 Aug 26 14:19 ..
-rw-r--r--   1 u277084  fnusr          2 Sep 12 08:36 1
-rwxrwxrwx   1 u277084  fnusr        138 Sep 13 02:10 samp.sh
drwxr-x---   3 u277084  fnusr         13 Oct  3 09:02 .
drwx------   2 u277084  fnusr          5 Oct  3 10:50 .ssh
-rw-------   1 u277084  fnusr      14538 Oct  3 11:06 .sh_history

SSH is picky about the permissions of your home directory itself, not just the things inside it. What are the permissions on your home directories?

ls -ld ~/

Please find the permissions

$ ls -ld ~/
drwx------   3 u277084  fnusr         14 Oct  4 03:58 /home/u277084/