Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize automatic login of except

Shulou Source: shulou.com Published: 2022-06-03 06:54:49 11月15日 Update

This article mainly shows you "how to achieve except automatic login", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to achieve except automatic login" this article.

The code is as follows:

#! / usr/bin/expect-f

Set timeout 30

Set host "192.168.1.198"

Spawn ssh $host

Expect_before "no)? {

Send "yes\ r"}

Sleep 1

Expect "password:"

Send "123456\ r"

Expect "* #"

Send "echo my name is fivetrees > / root/fivetrees.txt\ r"

Interact

# #--

The code is as follows:

[root@fivetrees ~] # cat expect

#! / usr/bin/expect

For {set I 10} {$I

Tags: Code login content articles learning help usage commands passwords methods easy to understand more organization users user names knowledge editing industry information information channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Linux Shulou Technology Apple Docker