Ssh command without password - Not working

Hi,
I have followed the below commands for key generation and ssh from one server to another with user mqm

cd /var/mqm/.ssh
mqm@A:~> ssh-keygen -t rsa
<public key creation>
mqm@A:~> ssh mqm@B mkdir -p .ssh
mqm@B's password: <entered_password>

mqm@A:~> cat /var/mqm/.ssh/id_rsa.pub | ssh mqm@B 'cat >> /var/mqm/.ssh/authorized_keys'

mqm@A:~> ssh mqm@B

But still it prompts for a password. Can anyone please help on the below.

Thanks,
Anusha M

1) You create directory .ssh ( but why -p?) only what permissions has it ? shoudl be read only for the user...
2) Your cat command will also ask you tha password since the key has not been transfered yet.. and that method may not be all that safe of corruption.. the safest would have been to copy the file to add .A extension, then scp that file to server B in her .ssh directory, then update authorized_keys file

It is also sensitive to the permissions of your home directory, it should not be world-readable.

Do you mean world- (or group-) writeable?

I usually have home directories world-readable and I don't recall that ever causing problems with passwordless SSH on any OS.

Yes, thank you.