Using Node.js to SSH and then telnet from within the SSH session





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















At my job, we frequently need to SSH into a linux server and from within the session, telnet to another modem/router and execute various commands.



My question is, would it be possible to do this using simple-ssh or ssh2shell Node.js packages. I can login to the SSH session and execute commands without issue but there doesn't seem to be a way to login to the telnet session and maintain the connection.



Literally telnet.










share|improve this question

























  • When you say “Telnet” do you literally mean telnet or you mean another SSH session?

    – JakeGould
    Feb 6 at 19:25











  • Welcome to Super User! You can freely edit your own posts but for your protection, this must be done under the original user account. It looks like you have created a second account, which will also interfere with your ability to comment within your thread and to accept an answer. See Merge my accounts to get your accounts merged, which will solve the problem.

    – fixer1234
    Feb 8 at 5:50


















0















At my job, we frequently need to SSH into a linux server and from within the session, telnet to another modem/router and execute various commands.



My question is, would it be possible to do this using simple-ssh or ssh2shell Node.js packages. I can login to the SSH session and execute commands without issue but there doesn't seem to be a way to login to the telnet session and maintain the connection.



Literally telnet.










share|improve this question

























  • When you say “Telnet” do you literally mean telnet or you mean another SSH session?

    – JakeGould
    Feb 6 at 19:25











  • Welcome to Super User! You can freely edit your own posts but for your protection, this must be done under the original user account. It looks like you have created a second account, which will also interfere with your ability to comment within your thread and to accept an answer. See Merge my accounts to get your accounts merged, which will solve the problem.

    – fixer1234
    Feb 8 at 5:50














0












0








0








At my job, we frequently need to SSH into a linux server and from within the session, telnet to another modem/router and execute various commands.



My question is, would it be possible to do this using simple-ssh or ssh2shell Node.js packages. I can login to the SSH session and execute commands without issue but there doesn't seem to be a way to login to the telnet session and maintain the connection.



Literally telnet.










share|improve this question
















At my job, we frequently need to SSH into a linux server and from within the session, telnet to another modem/router and execute various commands.



My question is, would it be possible to do this using simple-ssh or ssh2shell Node.js packages. I can login to the SSH session and execute commands without issue but there doesn't seem to be a way to login to the telnet session and maintain the connection.



Literally telnet.







ssh javascript node.js






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 6 at 21:30









Christopher Hostage

3,7901229




3,7901229










asked Feb 6 at 19:17









user994994user994994

1




1













  • When you say “Telnet” do you literally mean telnet or you mean another SSH session?

    – JakeGould
    Feb 6 at 19:25











  • Welcome to Super User! You can freely edit your own posts but for your protection, this must be done under the original user account. It looks like you have created a second account, which will also interfere with your ability to comment within your thread and to accept an answer. See Merge my accounts to get your accounts merged, which will solve the problem.

    – fixer1234
    Feb 8 at 5:50



















  • When you say “Telnet” do you literally mean telnet or you mean another SSH session?

    – JakeGould
    Feb 6 at 19:25











  • Welcome to Super User! You can freely edit your own posts but for your protection, this must be done under the original user account. It looks like you have created a second account, which will also interfere with your ability to comment within your thread and to accept an answer. See Merge my accounts to get your accounts merged, which will solve the problem.

    – fixer1234
    Feb 8 at 5:50

















When you say “Telnet” do you literally mean telnet or you mean another SSH session?

– JakeGould
Feb 6 at 19:25





When you say “Telnet” do you literally mean telnet or you mean another SSH session?

– JakeGould
Feb 6 at 19:25













Welcome to Super User! You can freely edit your own posts but for your protection, this must be done under the original user account. It looks like you have created a second account, which will also interfere with your ability to comment within your thread and to accept an answer. See Merge my accounts to get your accounts merged, which will solve the problem.

– fixer1234
Feb 8 at 5:50





Welcome to Super User! You can freely edit your own posts but for your protection, this must be done under the original user account. It looks like you have created a second account, which will also interfere with your ability to comment within your thread and to accept an answer. See Merge my accounts to get your accounts merged, which will solve the problem.

– fixer1234
Feb 8 at 5:50










1 Answer
1






active

oldest

votes


















-1














Just run the telnet command the same way you issue any other command to the SSH session.



Then your question becomes the same as this:
https://stackoverflow.com/questions/7013137/automating-telnet-session-using-bash-scripts/7021653






share|improve this answer





















  • 1





    This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review

    – music2myear
    Feb 6 at 21:42











  • Unless he can run the telnet command, in which case this IS the answer. The only limitation is availability of the telnet command on the system he has SSHed in to.

    – HackSlash
    Feb 6 at 22:17












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1402820%2fusing-node-js-to-ssh-and-then-telnet-from-within-the-ssh-session%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









-1














Just run the telnet command the same way you issue any other command to the SSH session.



Then your question becomes the same as this:
https://stackoverflow.com/questions/7013137/automating-telnet-session-using-bash-scripts/7021653






share|improve this answer





















  • 1





    This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review

    – music2myear
    Feb 6 at 21:42











  • Unless he can run the telnet command, in which case this IS the answer. The only limitation is availability of the telnet command on the system he has SSHed in to.

    – HackSlash
    Feb 6 at 22:17
















-1














Just run the telnet command the same way you issue any other command to the SSH session.



Then your question becomes the same as this:
https://stackoverflow.com/questions/7013137/automating-telnet-session-using-bash-scripts/7021653






share|improve this answer





















  • 1





    This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review

    – music2myear
    Feb 6 at 21:42











  • Unless he can run the telnet command, in which case this IS the answer. The only limitation is availability of the telnet command on the system he has SSHed in to.

    – HackSlash
    Feb 6 at 22:17














-1












-1








-1







Just run the telnet command the same way you issue any other command to the SSH session.



Then your question becomes the same as this:
https://stackoverflow.com/questions/7013137/automating-telnet-session-using-bash-scripts/7021653






share|improve this answer















Just run the telnet command the same way you issue any other command to the SSH session.



Then your question becomes the same as this:
https://stackoverflow.com/questions/7013137/automating-telnet-session-using-bash-scripts/7021653







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 6 at 22:18

























answered Feb 6 at 21:07









HackSlashHackSlash

2,3722723




2,3722723








  • 1





    This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review

    – music2myear
    Feb 6 at 21:42











  • Unless he can run the telnet command, in which case this IS the answer. The only limitation is availability of the telnet command on the system he has SSHed in to.

    – HackSlash
    Feb 6 at 22:17














  • 1





    This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review

    – music2myear
    Feb 6 at 21:42











  • Unless he can run the telnet command, in which case this IS the answer. The only limitation is availability of the telnet command on the system he has SSHed in to.

    – HackSlash
    Feb 6 at 22:17








1




1





This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review

– music2myear
Feb 6 at 21:42





This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review

– music2myear
Feb 6 at 21:42













Unless he can run the telnet command, in which case this IS the answer. The only limitation is availability of the telnet command on the system he has SSHed in to.

– HackSlash
Feb 6 at 22:17





Unless he can run the telnet command, in which case this IS the answer. The only limitation is availability of the telnet command on the system he has SSHed in to.

– HackSlash
Feb 6 at 22:17


















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • 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%2fsuperuser.com%2fquestions%2f1402820%2fusing-node-js-to-ssh-and-then-telnet-from-within-the-ssh-session%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

Plaza Victoria

Puebla de Zaragoza

Musa