How to change VNC password on Linux

The purpose of this tutorial is to show how to change the VNC password on a Linux system. This guide assumes that you have already installed VNC correctly and just need to change the password.

In this tutorial you will learn:

  • How to change VNC password on Linux
How to change VNC password on Linux
How to change VNC password on Linux
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Any Linux system
Software RealVNC, UltraVNC, TightVNC, TigerVNC, or other VNC program
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

How to change VNC password on Linux




If you have installed RealVNC, UltraVNC, TightVNC, TigerVNC, or another VNC program on your Linux system, the VNC password is stored inside of the ~/.vnc/passwd file. The password is stored at this location when the VNC server starts for the first time.

To update or change your VNC password you should use the vncpasswd command. vncpasswd will promt you two times to enter your new password:

$ vncpasswd
Password:
Verify:

The vncpasswd command also accepts a password input from STDIN which also allows you to store the password file into different location. The following example will change the VNC password to MYVNCPASSWORD and store it to ~/.secret/vncpass given that the .secret directory exists:

$ echo MYVNCPASSWORD | vncpasswd -f > ~/.secret/passvnc

Closing Thoughts

In this tutorial, we saw how to change the VNC password on a Linux system. As this password will be used to remotely access your system, it is important to choose a secure password. Use the vncpasswd command any time that you need to change the VNC password again.



Comments and Discussions
Linux Forum