Posts: 368
Joined: Sun Jun 24, 2012 6:25 am
Location: UK
Contact: Website

Resetting VNC Password

Fri Nov 23, 2018 9:28 pm


I have ssh access to as remote R-Pi with sudo privileges.For some reason I am unable to log in to VNC server, either password or username is wrong.

As I have previously done this via an ssh tunnel I did not have a strong password but currently I am making a mistake.

Is there a file listing VNC usernames or is there a way to reset it? raspi-config is only able to enable or disable so I can't use that.


Posts: 3755
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Resetting VNC Password

Fri Nov 23, 2018 10:12 pm

On a Mac you can try:

1) Right click the connection icon, select properties and on the 'general' tab press the 'forget sensitive data' button to clear the password
2) Select the 'expert' tab, scroll down to UserName and clear that

I assume its similar on a PC :lol:

The only other thing you can try is to delete the connect and recreate it BUT you may have to delete the Pi details out of the 'identities' file one the hidden '.vnc. folder found normally at ~/.vnc NOTE: This can kill connections to other machines so make a back up first :o :shock: :o
Need Pi spray - these things are breeding in my house...

User avatar
Posts: 227
Joined: Thu Apr 28, 2016 1:47 pm
Location: Cambridge, UK
Contact: Website

Re: Resetting VNC Password

Tue Nov 27, 2018 10:22 am

It sounds like you are trying to reset the password on the server?

I'm assuming you're using the RealVNC service mode server here, which is what is enabled from raspi-config. By default the VNC Server will use the credentials of the users on the system, (i.e. pi/raspberry by default), and it will allow access to users that are members of the sudo group.

You may have configured it to use VNC authentication, where you specify a separate password to use with VNC. You can set this using the "vncpasswd" command.

If all else fails, you can revert to the default configuration by removing the file /root/.vnc/config.d/vncserver-x11 (or move it somewhere safe in case you want to revert it later), and restarting the service with "sudo systemctl restart vncserver-x11-serviced".

Return to “General discussion”