Here a script you can use. may help. You need expect on your system.
command: myvncpasswd mypassword
should do the rest for you.
its an ugly script. havn't used expect in a while.
Also my man page did not show a -f switch for vncpasswd.
john@sunnyday:~$ more myvncpasswd
#!/usr/bin/expect --
spawn vncpasswd
sleep 1
expect "Password: "
sleep 1
send "$argv\r"
sleep 1
expect "Verify: "
sleep 1
send "$argv\r"
sleep 1
expect "$"
john@sunnyday:~$
(E-Mail Removed) (Tony) wrote in message news:<(E-Mail Removed). com>...
> Hi - I have tried in vain to automate setting the vnc password from
> stdin. The docs say you can do it with vncpasswd -f:
>
> eg:
>
> echo myvncpassword|vncpasswd -f
>
> This doesn't work (I can't log in using the vnc viewer). no error,
> just some funny characters output, which I assumed was the encrypted
> stdout)
>
> so I tried putting the password in a file deleteme.tmp:
>
> cat deleteme.tmp|vncpasswd -f
>
> This doesn't work - same output.
>
> Then I read it needs a carriage return so I put a cr in the
> deleteme.tmp file:
>
> This doesn't work - same output.
>
> Then I put the password in twice into the file on the next line:
>
> This doesn't work - same output.
>
> I put the same password in manually, and everything works fine. What
> am i missing here?
>
> I'm using tightvnc on Redhat AS3.
>
> Thanks in advance
>
> Tony