iterm2使用profile功能,ssh登陆

ssh用法

ssh <username>@<host>ssh

ssh -p <port> <username>@<host>spa

脚本

#!/usr/bin/expect -f
set password <password>
set user <username>
set host <host>

set timeout -1

spawn ssh $user@$host
expect "*assword:*"
send "$password\r"
interact
expect eof

脚本保存到某一目录code

profile

输入图片说明

相关文章
相关标签/搜索