I was recently asked how to reset a VNC Server password on a Linux machine.
For those that would also like to know here is how I did it.
You can either connect to the machine remotely over an ssh program like putty or you can do this directly from the terminal.
Open up a command prompt for the user that you have vnc server running as.
Then type
vncpasswd
You will then be prompted to enter a new password twice. Choose your new vnc server password and then restart the vncserver service using the following command.
service vncserver restart
The above commands work when run as the root user on Centos but should work similarly on most other variation of Linux.
Hope this helps.
More How To Articles
Thanks for the tip. I have been fighting with VNC Server for a while trying to figure this out.
thanks that was very helpfull
thanks for the info.i am able to reset the password successfully
Simple and accurate for CentOS. Thanks!
so simple and worked! thanks a lot
Thanks a lot the above procedure worked fine for me
Thnks Buddy, i have done in Backtrack
Thanks for the post.
It was helpful.
Can it be applied to reset the password if I forgot the old password?
Can it be applied on Raspberry Pi? I run Raspbian on it.
thanks a lot for the info
It doesn't work on raspian, when i try to reset it it says:
vncserver: unrecognised service
Hey gentlemen!!
I read your post but it doesn't work for me. I am trying to connect to my remote server red hat 5.2 by using Tight VNC Viewer installed on my local system XP. My /etc/sysconfig/vncserver contains following entry.
VNCSERVERS="3:oracle"
VNCSERVERARGS[3]="-geometry 1024×768"
I did following steps
1. Login as oracle (by using putty) and then fire $vncpasswd command to change password.
2. Then Login as root and restarted VNC service
3. Then I tried to connect to my remote host through tightVNC
But it returns error "Authentication Failed" even though i am entering correct password. It seems to me that it is not getting my changed password yet mean while I don't know old password and that's why i changed it.
So plz can anybody help me to resolve this issue? Is password for VNC user stored in any file in user readable form?
Optionally you can send me mail on tusharlapani@gmail.com if you have any
solution.
Thanks
Simple and accurate. Thanks!
how to reset vncserver password on raspian..help me please.. i try insert vncpasswd and key in the new password.but cannot restart the service…help me
worked for me. however, i have to use command "vncserver restart" to restart vnc instead of service vncserver restart.
thanks
Interesting! I am also getting authentication failed when connecting from my raspian machine to the pi running the vncserver after changing the password (to what I guessed was the old password). However, I am connecting successfully from my Blackberry Playbook tablet (using iMT VNC). I did not change the stored password on the Playbook, therefore I had not forgotten the original vncserver password. Oh yes, I also couldn't restart the server, I just re-booted. Will investigate.
It worked for me using as a guest a raspberry pi B+ with raspian and a windows 7 with a tightvnc as a client. Thank you very much!
Thanks. It was of great help
Hello
Thank you, works fine on my raspberry ! You have saved my time !
greetings from France
JPh
Today (2014-03-26), using suggested commands via iMac SSH (wifi), I reset the tightvncserver password on my RPi (NOOBS_v1-3-2 updated)…
I also got the 'vncserver: unrecognised service' message… but IGNORED it, and tried an iMac VNC (wifi) connection… success !
I've just used it successfully on RPi via ssh from iMac… I ignored the apparent 'unrecognised service' error !
Using password file /home/pi/.vnc/passwd
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
pi@raspberrypi ~ $ service vncserver restart
vncserver: unrecognized service
Thank you, that worked without restarting the server
Good posts last forever – worked in my case: I could only remember the view only password. reset both passwords and bam – mouse and keyboard functional again.