sshpass

user-pic
Vote 0 Votes

一般是建 Key 來達成 ssh 免密碼, 若不想建 Key, 可以用 sshpass
sshpass 可以在 ssh 時自動將密碼帶入
密碼可以用檔案(-f filename)或參數(-p password)或變數SSHPASS(-e)帶入
e.g.
sshpass -f pass_file ssh user@somewhere.com
sshpass -p password ssh user@somewhere.com
export SSHPASS=password
sshpass -e user@somewhere.com
當然也可以直接執行所連線主機的 command
sshpass -e user@somewhere.com cat /etc/hosts

About this Entry

This page contains a single entry by Pank published on May 11, 2016 10:16 PM.

Opera built-in VPN was the previous entry in this blog.

Regex geedy and non-greedy match is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives