Linux command
vncpasswd 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Set VNC password for current user (interactive prompt)
vncpasswd
Set password to a specific file
vncpasswd [~/.vnc/passwd]
Create password from stdin using filter mode
echo "[password]" | vncpasswd -f > [~/.vnc/passwd]
Set both full-control and view-only passwords from stdin
printf "[password]\n[viewpassword]\n" | vncpasswd -f > [~/.vnc/passwd]
说明
vncpasswd creates or changes VNC password files used by VNC servers for authentication. When run without arguments, it prompts for a password and stores it in ~/.vnc/passwd. Passwords must be at least 6 characters in interactive mode (the -f filter mode accepts any length). Only the first 8 characters are significant due to the DES-based encoding used. The stored password is obfuscated but not securely encrypted. The filter mode (-f) reads plain-text passwords from stdin and outputs encrypted versions to stdout, useful for scripted password file creation. Up to two passwords can be provided separated by newlines: the first for full-control and the second for view-only access.
参数
- -f
- Filter mode: read plain-text password from stdin, write encrypted version to stdout. Short or empty passwords are silently accepted in this mode.
FAQ
What is the vncpasswd command used for?
vncpasswd creates or changes VNC password files used by VNC servers for authentication. When run without arguments, it prompts for a password and stores it in ~/.vnc/passwd. Passwords must be at least 6 characters in interactive mode (the -f filter mode accepts any length). Only the first 8 characters are significant due to the DES-based encoding used. The stored password is obfuscated but not securely encrypted. The filter mode (-f) reads plain-text passwords from stdin and outputs encrypted versions to stdout, useful for scripted password file creation. Up to two passwords can be provided separated by newlines: the first for full-control and the second for view-only access.
How do I run a basic vncpasswd example?
Run `vncpasswd` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -f do in vncpasswd?
Filter mode: read plain-text password from stdin, write encrypted version to stdout. Short or empty passwords are silently accepted in this mode.