VNC stands for Virtual Network Computing. In Linux, VNC is a system that allows a computer user to control another computer remotely using a graphical interface. That is to say, VNC enables the user to interact with the Linux desktop using a keyboard and mouse of a different computer over a network.  We require a VNC password to authenticate a user to the VNC server, i.e., the application running on the remote computer. That is to say, an anonymous person will not be allowed access to the VNC server without verification. Nowadays, recent Linux releases come with VNC in their installations. If you do not have VNC installed, follow these steps on How to Install VNC on Ubuntu. Now, let’s continue and look at how to change the VNC password in Linux. So, let’s dive right in!

What is a VNC Password?

A VNC password is used to authenticate a user to the VNC server. As a result, once a user is authenticated, they can remotely interact and control the desktop, keyboard, and mouse of another computer. Your VNC password and the password you use to log in to your Linux computer are distinct entities. Therefore it is advisable to set your VNC password to be different from your Linux login password. Further, let’s note that a user usually sets and can change the VNC password themselves. This password is generally encrypted. Similarly, a user can decrypt or delete it and replace it with another one. Deleting and replacing it is the option that is mainly recommended. 

How to Change the VNC Password.

We use the VNC password command to set or change the VNC password in Linux. The VNC password is stored in an encrypted version. Also, ensure that you set a strong password so that the system is not accessed by unauthorized persons. Here is the command: The vncpasswd command requests for a VNC password to access VNC desktops. It allows us to change a VNC password for security reasons. It is also advisable to change your password after every few months to lower the risk of someone obtaining it and gaining access to your system.  The vncpasswd command also lets us set the VNC password for the first time. It requests the password twice. The first password is the primary password. Here is how to change the VNC password in Linux: If the password is more than 8 characters, the additional characters will be truncated. In other words, the extra characters will be ignored.  The second password is the read-only password. If it is too short, it will not be saved. It authenticates for view-only desktops.

Where is the VNC Password stored?

The VNC password is stored in the passwd file, which is usually in the .vnc folder by default. In other words, this is the location of the password when the VNC server runs for the first time.  If we run the command vncpasswd and get the alert VNC directory does not exist, it means that the .vnc folder and passwd file do not exist. In the same vein, the vncpasswd command goes ahead and creates the hidden .vnc folder. You will be prompted to enter the password and verify it to create the folder and file successfully. When you are done with that, you may want to view it.  Here is how you can check where the VNC password is stored using the graphical user interface. Here is how to view this same folder on Command Terminal. For clarity, here is the default path where the VNC password is stored.

How to Remove the VNC Password.

We usually remove the VNC password to allow another one to be created or changed and then stored. To remove the passwd file which contains the VNC password, use the command below in your Command Terminal. You can also remove the file using the graphical interface.  Here is how: You can confirm by checking in the .vnc folder that the file doesn’t exist anymore.   We’ve come to the end of our article. Certainly, remember that you should not share your VNC password with anyone because it gives them full control of your system. That means they can change important settings or even delete critical files. In conclusion, we hope you have learned How to Change the VNC password in Linux. We also hope we helped you learn more about where the VNC password is stored. If you have any questions or suggestions, let us know in the comment section below. If this guide helped you, please share it. 🙂