ruby - wants to provide password to tightvnc server by using script -


i installating tightvnc server on ubuntu machine using ruby script script contain following:

#!/usr/bin/ruby env     `sudo apt-get --force-yes -y install tightvncserver` `printf "%s\n%s\n" "demo123" "demo123" | vncserver :1` 

i used printf way because vncserver ask password on terminal, way failed, better way solve this?

you'd want use vncpassword create password file:

step 2. create vnc password file “vncpassword”.

$ vncpasswd using password file /home/user/.vnc/passwd vnc directory /home/user/.vnc not exist, creating. password: [type vnc password here] verify: [type vnc password here] enter view-only password (y/n)? n 

and use file in script:

#!/usr/bin/ruby env     `sudo apt-get --force-yes -y install tightvncserver` `vncserver -p /home/user/.vnc/passwd` 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -