开发者

Prevent interactive ssh prompts

I have an ssh script that uses a local key for login to the remote host - nothing too exciting there. The key is passworded and I usually add it to an agent to avoid prompting.

Occasionally I run the program before the agent is running and it will hang waiting for the unlock phrase开发者_开发知识库. In such cases, rather than prompt interactively, I want the command to simply fail.

Anyone know if there's an option for this?


Sure is.

ssh REMOTE_HOST -o "BatchMode yes"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜