Wednesday, May 20, 2009

How to change VNC Server password on Linux

I was recnetly asked how to reset a password for VNC Server 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.

15 comments:

Anonymous said...

Thanks for the tip. I have been fighting with VNC Server for a while trying to figure this out.

Anonymous said...

thanks that was very helpfull

krishna said...

thanks for the info.i am able to reset the password successfully

Maxwell Smart said...

Simple and accurate for CentOS. Thanks!

Narendra Lengade said...

Thanks a lot the above procedure worked fine for me

Unknown said...

so simple and worked! thanks a lot

Anonymous said...

Thnks Buddy, i have done in Backtrack

Jim Zubemo said...

Thanks for the post.
It was helpful.

ANAND SAKTHIVEL S said...

Simple and accurate. Thanks!

Anonymous said...

thanks a lot for the info

Anonymous said...

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 1024x768"

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

Marc Sarri said...

It doesn't work on raspian, when i try to reset it it says:
vncserver: unrecognised service

Khingcat said...

Can it be applied on Raspberry Pi? I run Raspbian on it.

Khingcat said...

Can it be applied to reset the password if I forgot the old password?

syuz said...

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