Shell scripts for ssh session autologin

on

Programmer's Blog

The following code is a shell script to make auto login session for ssh

To use the below code, the “expect” must be installed in /usr/bin/expect.

to use: copy and paste codes in .sh

//—————————-

#!/usr/bin/expect
 spawn ssh username@host
 expect "<words contained in prompt>"
 send "passwordr"
//..... (more expect and send statement for pipe)
 interact

Lihat pos aslinya

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s