通过命令行自动化 VNC 授权过程
我收到的输入为 vnc://172.16.41.101&passwd=test
我想对此输入执行的操作是:
1. 提取IP地址。
2. 提取密码。
3. 使用提供的 IP 和密码启动 vncviewer。
4. 一旦收到输入,所有这些都应该自动化。
提取ip和密码很容易。 然后我使用提供的 IP 启动 vncviewer,但如何将密码传递给它而不提示用户输入密码?
I am receiving a input as vnc://172.16.41.101&passwd=test
What i want to do with this input is :
1. Extract the IP address.
2. Extract the password.
3. Launch vncviewer with the ip and password provided.
4. All this should this be automated, once the input is received.
extracting the ip and password is easy.
then i launch the vncviewer with the ip provided, but how do i pass the password to that without prompting the user for the password ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您的
vncviewer
没有-autopass
选项,您可以使用vncpasswd
生成可传递到-passwd
选项:If your
vncviewer
does not have the-autopass
option, you can usevncpasswd
to generate a password file that can be passed into the-passwd
option:假设(通过标签)您正在从命令提示符使用 vncviewer 程序,我认为您可以执行以下操作:
使用您的示例:vnc://172.16.41.101&passwd=test
Assuming (by the tags) that you are using the vncviewer program from the command-prompt i think you could do something like this:
using your example: vnc://172.16.41.101&passwd=test
-autopass
在我的vncviewer
版本中不可用。工具
vncpasswd
(显然与vnc-server
一起提供)都没有。使用
xvfb
、x11vnc
进行演示,在虚拟 X 环境中运行程序gimp
(如果已安装)。并使用
vncviewer
显示,而不提示输入密码。一班轮:
The
-autopass
was unavailable in my version ofvncviewer
.Neither the tool
vncpasswd
(Apparently comes withvnc-server
).Demo using
xvfb
,x11vnc
, run the programgimp
, if installed, in a virtual X env.And display with
vncviewer
without prompting for a password.One liner:
如果没有提供更多详细信息,很难完美回答这个问题,例如发布代码/命令/配置以实现我的建议...例如,您需要准确具体说明哪个 vnc 服务器、客户端、平台也就是说
,如果您可以重新设计所有这些的工作原理 - 我建议根本不使用密码!
相反,设置SSH 隧道,并使用密钥对身份验证来保护它。使用此计划时,您甚至可以删除 VNC 的任何防火墙例外!
如果您这样做,不仅不需要提供密码,而且整个 VNC 系统也会更加安全!
Without more detail provided, it's hard to answer this perfectly, e.g. to post the code / commands / configurations to achieve what I'd suggest... For instance, you'd need to specific exactly which vnc server, client, the platform for each side, etc, etc.
That said, if you can redesign how all of this works - I recommend not using a password at all!
Instead, setup an SSH Tunnel, and use key pair authentication to secure it. You can even remove any firewall exceptions for VNC when using this plan!
If you do this, not only will you not have to provide a password, but the entire VNC system will be far more secure!