In this post, we will be discussing about various issue faced in VNC. And, to top it all, how to change the VNC Password in Linux. So, let’s start with the topic right away!

How to change the VNC Password in Linux

Before we move with the topic, let’s first see what is VNC! VNC stands for Virtual Network Computing. In Linux, VNC is a system that allows a computer user to remotely control another computer through a graphical interface. So to say, VNC allows a user to interact with the Linux desktop using another computer’s keyboard and mouse over a network. On that note, as always we have seen that for authentication purposes you require a password. So, here also you will require to enter your VNC password to authenticate yourself as a valid, legal user. But, what if you have forgotten your password, what do you do now? So, we will look in all these scenarios a while later, as we proceed further.

How to change the VNC Password in Linux

Your VNC Password

Your VNC password is used to authenticate you as a valid user to the VNC server. Once authenticated, you can interact remotely and control another computer’s desktop, keyboard, and mouse.

Remember, your VNC password and the password you use to log in to your Linux computer are two different things. Therefore, it is advisable to choose your VNC password differently from your Linux login password.

Also note that a user usually sets and can change the VNC password. This password is usually encrypted. Likewise, a user can decrypt it or delete it and replace it with another. Deleting and replacing is the option that is most recommended. So, how do you change your VNC Password? Let’s see!

Here’s a comparative study on Google Password Manager and LastPass! Check this out to learn about two great password managers!! –>

Changing your VNC Password

You can use the “vncpasswd” command to set/change your VNC Password through Linux. This time, remember to set a more secure password so that the system cannot be accessed by unauthorized people.

$ vncpasswd
  • The “vncpasswd” command asks for a VNC password to access VNC desktops. It allows us to change a VNC password for security reasons.
  • You can also use the “vncpasswd” command to set the VNC password for the first time.

So, here’s the complete steps to change your VNC password on Linux:

  • First, open your Command Terminal by pressing “Ctrl + Alt + T”.
  • Now, type in “vncpasswd“.
  • Next, enter your VNC Password (this will be your primary password).
  • Thereafter, to create a “view-only password” (the secondary password) press “Y“.
  • Next, enter your secondary password to confirm its setup.
  • That’s it! Hurray! You have successfully setup your passwords 🙂
How to change the VNC Password in Linux

Here’s what you need to do if your password appears in a data leak!! –>

VNC Password — Where is it stored?

Your VNC password is stored in the “passwd” file, which is located in the “.vnc” folder by default. In other words, this is where VNC stores your password when you start it for the first time.

If we run the “vncpasswd” command and get the message VNC directory does not exist, it means that the .vnc folder and the passwd file do not exist. In the same way, the vncpasswd command creates the hidden .vnc folder. You will be prompted to enter and confirm the password to successfully create the folder and file.

Checking where your VNC Password is stored

Here’s how you can check where your VNC Password is stored using the GUI:

  • First up, open the “HOME” folder.
  • Thereafter, click on “View” —> “Show Hidden Files
  • Next, click on the “.vnc” folder to open it.
  • There you go, you will now see the “passwd” file, double-click to open it.
  • Hurray! 🙂


  • If you want to check the “passwd” file destination using CLI, here you go:
    • First, change to home by typing ‘cd /home’.
    • Then, type the command “ls -a” to display the hidden files.
    • So, now, you will see the .vnc folder among other hidden files and folders.
    • Now, access the folder by typing ‘cd .vnc/’
    • Finally, type the “ls” command to display the files inside the folder.
    • There you go, you will find the “passwd” file in there.
$ cd /home
$ ls -a
$ cd .vnc/
$ ls

Note: Your VNC Password is always stored here: “$HOME/.vnc/passwd

Want to install Flutter on your Windows/Mac/Android device? Check this out!! –>

Removing/Deleting your VNC Password

Normally, you remove the VNC password so that you can create a new one or change an old one. To remove the passwd file that contains the VNC password, use the following command in your Command Terminal.

$ sudo rm ~/.vnc/passwd

You can also remove the file using the GUI as shown below:

  • First up, open the “HOME” folder.
  • Thereafter, click on “View” —> “Show Hidden Files
  • Next, click on the “.vnc” folder to open it.
  • Thereafter, right-click on the “passwd” file and select “Move to Trash“.
  • And, finally, check the” .vnc” folder to see if the file is no longer there.
  • That’s it! Now, enjoy :).
How to change the VNC Password in Linux

Here’s how you can install NodeJS and NPM on Windows and Mac!! –>

WRAPPING UP — How to change the VNC Password in Linux!! –>

By now, I can safely, vouch that you have definitely got the answers to your question, how to change the VNC Password in Linux?. Not only that, you have also come to know about various other facets related to VNC and your VNC Password. So, all in all, you have acquired a great deal of knowledge. With that, do remember, if you’ve any confusion or questions thus whatsoever about this topic, you can always reach out to me in the comments section and I will readily try to help. On that note, until the next time, see ya!! Goodbye!!

Categorized in: