I have a few machines that I have to install tigervnc-server on.

After I install the package I have to run vncserver and enter the password for the VNC user.

Can I provide the password with a parameter or in some other way that does not include me entering password manually for every installation?

1 Answer 1


Assuming you have root privilege in your setup process, you could create the passwd using

# su myusername -c vncpasswd << EOF

This should create the .vnc/passwd file in user home dir.

Note: if you always set the same passwd, an alternative is to create the .vnc/passwd once manually and then just copy it on each server.

See also https://wiki.centos.org/HowTos/VNC-Server

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .