ssh脚本,linux ssh非交互脚本,sshpass-Linux命令之非交互SSH

 2023-09-23 阅读 23 评论 0

摘要:sshpass:用于非交互的ssh 密码验证,允许你用 -p 参数指定明文密码,然后直接登录远程服务器。 它支持密码从命令行,文件,环境变量中读取。Ubuntu/debian系列的linux系统安装简单,直接apt-get就好了:sudo apt-get install sshpasscentos系列的下载安

sshpass:用于非交互的ssh 密码验证,允许你用 -p 参数指定明文密码,然后直接登录远程服务器。 它支持密码从命令行,文件,环境变量中读取。

Ubuntu/debian系列的linux系统安装简单,直接apt-get就好了:

sudo apt-get install sshpass

centos系列的下载安装包,编译安装即可。

ssh脚本,~ sshpass

Usage: sshpass [-f|-d|-p|-e] [-hV] command parameters

-f filename   Take password to use from file

-d number     Use number as file descriptor for getting password

-p password   Provide password as argument (security unwise)

linux sh命令。-e            Password is passed as env-var "SSHPASS"

With no parameters - password will be taken from stdin

-h            Show help (this screen)

-V            Print version information

At most one of -f, -d, -p or -e should be used

ssh执行命令shell,基本使用:

sshpass -p passwd  ssh  user@ip

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/2/89396.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息