1.Run the following command in you local hosts:

j@local:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/j/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/j/.ssh/id_rsa.
Your public key has been saved in /home/j/.ssh/id_rsa.pub.
The key fingerprint is:
bc:8b:75:13:5a:d7:2e:99:01:5b:8f:8f:26:90:7a:69 j@local
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|          . .    |
|       . . + +   |
|        S + + o  |
|       . * o B   |
|      . E + * o  |
|       = o + .   |
|      . .        |
+-----------------+
j@local:~$

2.Now check these is a file named id_rsa.pub under the .ssh directory

j@local:~$ cd .ssh
j@local:~/.ssh$ ls
id_rsa  id_rsa.pub  known_hosts
j@local:~/.ssh$ cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAo454ZX8aTUkOHnmKfx2tAJQN6v/eg1TmpeK1gNij7Bqj0SzX/
Dpic94vzDZOus0KIhAZE4A88tfeiQjc62gj/1QDiEWfu7BRjZuWwoopGPYRmBcfyj+r2o7qyl+v33FYiJu2ix
JlJeLnSW0Vjp9jqG8WbOnz8JXPKYTzxvc62tzJOZ6GCI0xGP6Nu9qRKGWQa3w6u5wLYpbQNfRhUvxTlzjObxe
dbytK6Rdj8FSb+y5a05swJGP4oOHaoloN3RzSEPnRR4I9PBWidupnsyTAlO5DAJiJqNbPFugZ3p6ffKdVp5RG
FZ0wJnlDMGAAEXAaMqAyfZIPx6IAp53Y3mHCaw== j@local
j@local:~/.ssh$

3.Login to the remote server,then run the following command:

[j@remote ~]$ mkdir .ssh
[j@remote ~]$ cd .ssh
[j@remote .ssh]$vi authorized_key

Then copy to content of id_rsa.pub in step 2 to this file.
4.Done,now you can ssh to this remote server without password in your ubuntu.