PuTTY PSFTP 命令行以管理员身份运行,以用户身份失败 [英] PuTTY PSFTP command line works as Admin, fails as User
问题描述
我在使用 PuTTY PSFTP 时遇到了一个有趣的困境.
I have an interesting dilemma with PuTTY PSFTP.
设置...
Pageant .60
putty .60
使用的命令:
D:\psftp.exe -load myserver.domain.us.com -l User1 -b MyCommand Script
这将加载 PuTTY PSFTP,在 Pageant 的帮助下使用用户 ID 登录,然后使用脚本中的命令发送文件.
This loads PuTTY PSFTP, logs in using the user ID with the help of Pageant and then sends a file using commands in the script.
这在以管理员身份登录服务器时效果很好.以普通用户身份登录服务器时失败:
This works great while logged in as an Admin on the server. It fails while logged in as a regular user on the server:
"psftp: no hostname specified;"blah blah blah.
包含 -v
不会显示更多消息.
Including -v
reveals no further messages.
当涉及到 PuTTY 时,服务器管理员和普通用户之间的权限或其他设置可能存在哪些差异?
What possible delta could there be with permissions or other settings between a server Admin and regular user when it comes to PuTTY?
推荐答案
您加载 PuTTY 存储的站点 myserver.domain.us.com
.
You load PuTTY stored site myserver.domain.us.com
.
它存储在本地帐户的 Windows 注册表中.
That is stored in Windows registry of the local account.
如果您使用不同的帐户运行脚本,它将看不到网站定义.
If you run the script using a different account, it won't see the site definition.
您必须完全在命令行上定义会话.你甚至可能尝试过的东西.
You have to define the session completely on command line. What you probably even attempted.
- 删除
-load
; - 添加
-ssh
以明确您要使用 SSH(但无论如何它都是默认设置) - 添加带有 SSH 主机密钥指纹的
-hostkey=...
(-hostkey
开关需要最新版本的 PuTTY,但您需要无论如何都要升级,0.60 版本不安全).
- Remove the
-load
; - Add
-ssh
to make it clear you want to use SSH (but it's default anyway) - Add
-hostkey=...
with a fingerprint of the SSH host key (you need the latest version of PuTTY for the-hostkey
switch, but you need to upgrade anyway, the version 0.60 is not secure).
D:\psftp.exe -ssh myserver.domain.us.com -hostkey=... -l User1 -b MyCommand Script
这篇关于PuTTY PSFTP 命令行以管理员身份运行,以用户身份失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!