美文网首页
iTerm2记住ssh登录密码

iTerm2记住ssh登录密码

作者: 三叉戟渔民 | 来源:发表于2020-04-30 16:59 被阅读0次

需求:

iTerm2连接服务器时,总是需要输入密码,现在想保存密码直接登录。

安装sshpass

1、下载sshpass
2、进入sshpass目录
3、运行./configure
4、运行sudo make install
5、运行sshpass测试是否安装成功

[@XXX-Pro:sshpass-1.06]$ 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)
   -e            Password is passed as env-var "SSHPASS"
   With no parameters - password will be taken from stdin

   -P prompt     Which string should sshpass search for to detect a password prompt
   -v            Be verbose about what you're doing
   -h            Show help (this screen)
   -V            Print version information
At most one of -f, -d, -p or -e should be used

应用

示例:使用用户名和密码登录服务器

[@X-Pro:sshpass-1.06]$ sshpass -p 'passwd' ssh root@192.168.3.10

集成iTerms

设置界面:
打开Profiles-Open Profiles-Edit Profiles
修改蓝框中的信息即可


image.png

快速打开


image.png

相关文章

  • Mac下使用iTerm2保存ssh登录密码方便无密登录

    Mac下使用iTerm2保存ssh登录密码方便无密登录 mac下使用iTerm2,通过命令ssh需输入密码访问li...

  • iTerm2记住ssh登录密码

    需求: iTerm2连接服务器时,总是需要输入密码,现在想保存密码直接登录。 安装sshpass 1、下载sshp...

  • linux 文件数据增量同步

    首先配置:ssh免密码登录 ssh免密码登录 同步脚本: /usr/bin/rsync -avz /datamnt...

  • SSH 相关的配置操作

    SSH 免密码登录 这里即A机想通过ssh免密码登录到B机。ssh 无密码登录需要使用到公钥和私钥。一般是在A机上...

  • banwanhost服务器全套

    ssh远程登录 修改root 密码 ssh 登录后,输入命令 passwd root,即可修改root密码 安装s...

  • Ubuntu的ssh

    安装ssh 创建root用户 配置本机无密码ssh登录 spark0免密码ssh登录spark1 spark1免密...

  • 远程登录

    远程登录另一台机器 SSH 原理与运用 用密码登录ssh user@host 密码:user(如ssh stude...

  • ssh免密码登陆远程主机

    ssh免密码登陆远程主机 使用密码登录,每次都必须输入密码,非常麻烦。好在SSH还提供了公钥登录,可以省去输入密码...

  • ssh证书登录

    前言 ssh有密码登录和证书登录,密码登录,特别是外网的机器,很容易遭到攻击。真正的生产环境中,ssh登录还是证书...

  • ssh 免密登陆

    密码登录原理: 首先我们来看一下传统的ssh 密码登录的具体过程: 密钥登录原理: ssh 免密登陆实战 实验说明...

网友评论

      本文标题:iTerm2记住ssh登录密码

      本文链接:https://www.haomeiwen.com/subject/klhtghtx.html