One way is to create a password file and use it (One time
Step 1 - (only if you do not have tightvncserver) - Install tightvncserver
- sudo apt-get install tightvncserver
Step 2 - Create a password file using vncpasswd command
Using password file /home/user/.vnc/passwd
VNC directory /home/user/.vnc does not exist, creating.
Password: [TYPE YOUR VNC PASSWORD HERE]
Verify: [TYPE YOUR VNC PASSWORD HERE]
Would you like to enter a view-only password (y/n)? n
Step 3 - Connect using vncviewer, this time using password file -
$ vncviewer remotehost.com -p ~/.vnc/passwd
Step 4 - Create an alias so that you do not have to type command all the time -
Step 5 - Now you can connect to your raspberry without password -
And there you go!! You can access pi without typing a password and a long command.