PuTTY PSFTP command line works as Admin, fails as User

我与影子孤独终老i 提交于 2019-12-08 06:24:13

问题


I have an interesting dilemma with PuTTY PSFTP.

Set up...

Pageant .60
putty .60

Used command:

D:\psftp.exe -load myserver.domain.us.com -l User1 -b MyCommand Script

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.

Including -v reveals no further messages.

What possible delta could there be with permissions or other settings between a server Admin and regular user when it comes to PuTTY?


回答1:


You load PuTTY stored site myserver.domain.us.com.

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.

  • 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


来源:https://stackoverflow.com/questions/42141404/putty-psftp-command-line-works-as-admin-fails-as-user

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!