Expect script multiple passwordspassing passwords to a scriptHuge delay in script response when using SFTP...

Is there an English equivalent for "Les carottes sont cuites", while keeping the vegetable reference?

What do these three diagonal lines that cross through three measures and both staves mean, and what are they called?

Why are road bikes (not time trial bikes) used in many triathlons?

What's the phrasal verb for carbonated drinks exploding out of the can after being shaken?

Identification of an AC transformer

Was Willow's first magic display (blazing arrow through arm) actual magic, and if not, what's the trick?

Is there a way to handmake alphabet pasta?

Can you perfectly wrap a cube with this blocky shape?

Using two linked programs, output ordinal numbers up to n

How are packets handled and prioritized over a link with multiple VLANS?

Source of story about the Vilna Gaon and immigration policy

Is it possible to cast two 9th level spells without taking a long rest in 5e?

Can a pizza stone be fixed after soap has been used to clean it?

Why limit to revolvers?

Why hasn't the U.S. government paid war reparations to any country it attacked?

Can both line and load go to same screw on a GFCI outlet?

What do mathematicians mean when they say some conjecture can’t be proven using the current technology?

Why doesn't philosophy have higher standards for its arguments?

Manually select/unselect lines before forwarding to stdout

What are "full piece" and "half piece" in chess?

Advice for paying off student loans and auto loans now that I have my first 'real' job

Why did Steve Rogers choose Sam in Endgame?

What systems of robust steganography are out there?

Is 7000 words too long for a chapter?



Expect script multiple passwords


passing passwords to a scriptHuge delay in script response when using SFTP with expectswitch user to sudo su root and connect the fttp get the file in local machine and unzip`Interact` not working as expected in bash/expect scriptingExpect script seems to ignore prompt (RSA fingerprint confirmation)Using expect script to automate password checking for a multitude of routersexpect script to autofill passwordShell Script to retrieve text from websiteExpect script to ssh into a remote host and change its passwordScript to return serial numbers of network switching equipment






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I want to change the password on my hardware.



Now, four passwords are used.
I want write expect script which auth in hardware and do something. But I dont know which password using in this device. And script need change password from array and try again to logining.



spawn telnet my_host
expect UserName {send adminr}
expect PassWord [one of array passwordsr]

{if auth ok}
do something
{else}
try another password

expect -re #
send "logoutr"
expect eof









share|improve this question









New contributor



Анатолий Дорошенко is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • I guess that English is not your first language, but can you please try to better describe what you are doing and what problem you are having?  Is this about logging in when you don’t know which password is used on which host?  What does it have to do with changing passwords?  What does it have to do with hardware? … … … … … … … … … … … … … … … Please do not respond in comments; edit your question to make it clearer and more complete.

    – Scott
    47 mins ago













  • I want loggin into my hardware with one of four password. I.e. try logging with first password, if password not much, try next etc... so I dont understand, how say to script this condition

    – Анатолий Дорошенко
    34 mins ago




















0















I want to change the password on my hardware.



Now, four passwords are used.
I want write expect script which auth in hardware and do something. But I dont know which password using in this device. And script need change password from array and try again to logining.



spawn telnet my_host
expect UserName {send adminr}
expect PassWord [one of array passwordsr]

{if auth ok}
do something
{else}
try another password

expect -re #
send "logoutr"
expect eof









share|improve this question









New contributor



Анатолий Дорошенко is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • I guess that English is not your first language, but can you please try to better describe what you are doing and what problem you are having?  Is this about logging in when you don’t know which password is used on which host?  What does it have to do with changing passwords?  What does it have to do with hardware? … … … … … … … … … … … … … … … Please do not respond in comments; edit your question to make it clearer and more complete.

    – Scott
    47 mins ago













  • I want loggin into my hardware with one of four password. I.e. try logging with first password, if password not much, try next etc... so I dont understand, how say to script this condition

    – Анатолий Дорошенко
    34 mins ago
















0












0








0








I want to change the password on my hardware.



Now, four passwords are used.
I want write expect script which auth in hardware and do something. But I dont know which password using in this device. And script need change password from array and try again to logining.



spawn telnet my_host
expect UserName {send adminr}
expect PassWord [one of array passwordsr]

{if auth ok}
do something
{else}
try another password

expect -re #
send "logoutr"
expect eof









share|improve this question









New contributor



Анатолий Дорошенко is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I want to change the password on my hardware.



Now, four passwords are used.
I want write expect script which auth in hardware and do something. But I dont know which password using in this device. And script need change password from array and try again to logining.



spawn telnet my_host
expect UserName {send adminr}
expect PassWord [one of array passwordsr]

{if auth ok}
do something
{else}
try another password

expect -re #
send "logoutr"
expect eof






bash scripting expect






share|improve this question









New contributor



Анатолий Дорошенко is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










share|improve this question









New contributor



Анатолий Дорошенко is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








share|improve this question




share|improve this question








edited 8 mins ago







Анатолий Дорошенко













New contributor



Анатолий Дорошенко is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








asked 56 mins ago









Анатолий ДорошенкоАнатолий Дорошенко

11 bronze badge




11 bronze badge




New contributor



Анатолий Дорошенко is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




New contributor




Анатолий Дорошенко is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • I guess that English is not your first language, but can you please try to better describe what you are doing and what problem you are having?  Is this about logging in when you don’t know which password is used on which host?  What does it have to do with changing passwords?  What does it have to do with hardware? … … … … … … … … … … … … … … … Please do not respond in comments; edit your question to make it clearer and more complete.

    – Scott
    47 mins ago













  • I want loggin into my hardware with one of four password. I.e. try logging with first password, if password not much, try next etc... so I dont understand, how say to script this condition

    – Анатолий Дорошенко
    34 mins ago





















  • I guess that English is not your first language, but can you please try to better describe what you are doing and what problem you are having?  Is this about logging in when you don’t know which password is used on which host?  What does it have to do with changing passwords?  What does it have to do with hardware? … … … … … … … … … … … … … … … Please do not respond in comments; edit your question to make it clearer and more complete.

    – Scott
    47 mins ago













  • I want loggin into my hardware with one of four password. I.e. try logging with first password, if password not much, try next etc... so I dont understand, how say to script this condition

    – Анатолий Дорошенко
    34 mins ago



















I guess that English is not your first language, but can you please try to better describe what you are doing and what problem you are having?  Is this about logging in when you don’t know which password is used on which host?  What does it have to do with changing passwords?  What does it have to do with hardware? … … … … … … … … … … … … … … … Please do not respond in comments; edit your question to make it clearer and more complete.

– Scott
47 mins ago







I guess that English is not your first language, but can you please try to better describe what you are doing and what problem you are having?  Is this about logging in when you don’t know which password is used on which host?  What does it have to do with changing passwords?  What does it have to do with hardware? … … … … … … … … … … … … … … … Please do not respond in comments; edit your question to make it clearer and more complete.

– Scott
47 mins ago















I want loggin into my hardware with one of four password. I.e. try logging with first password, if password not much, try next etc... so I dont understand, how say to script this condition

– Анатолий Дорошенко
34 mins ago







I want loggin into my hardware with one of four password. I.e. try logging with first password, if password not much, try next etc... so I dont understand, how say to script this condition

– Анатолий Дорошенко
34 mins ago












0






active

oldest

votes














Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






Анатолий Дорошенко is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f530379%2fexpect-script-multiple-passwords%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








Анатолий Дорошенко is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Анатолий Дорошенко is a new contributor. Be nice, and check out our Code of Conduct.













Анатолий Дорошенко is a new contributor. Be nice, and check out our Code of Conduct.












Анатолий Дорошенко is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f530379%2fexpect-script-multiple-passwords%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...