LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to run two codes of snippets in one time in ssh terminal (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-run-two-codes-of-snippets-in-one-time-in-ssh-terminal-4175488202/)

ytyyutianyun 12-16-2013 09:20 PM

How to run two codes of snippets in one time in ssh terminal
 
Forgive my laziness, I don't want to enter the "ssh node1" and "****" (Password) each time.
So I make a snippet.

It is well if I run two snippets for each has one code like:
snippet1
Code:

ssh node1
snippet2
Code:

****
But when I put into one snippet, it only works in the first line.
snippet
Code:

ssh node1
****

So I want to ask how how to run two codes of snippets in one time in ssh terminal.

Ps: I use the mobile, which application is Juicessh

berndbausch 12-16-2013 11:00 PM

Quote:

Originally Posted by ytyyutianyun (Post 5081895)
Forgive my laziness, I don't want to enter the "ssh node1" and "****" (Password) each time.
[...]
Ps: I use the mobile, which application is Juicessh

If I understand you right, you don't want to type the password . That's a very wise decision, not only because you are lazy, but also because it's more secure.

Juicessh might not have this function, but plain vanilla openssh allow you to connect with a key rather than a password. Google for "ssh logon key" or similar; http://linuxproblem.org/art_9.html has instructions that look good.

Once you have set up your keys on server and client, no password is needed anymore.

ytyyutianyun 12-17-2013 01:27 AM

Quote:

Originally Posted by berndbausch (Post 5081967)
If I understand you right, you don't want to type the password . That's a very wise decision, not only because you are lazy, but also because it's more secure.

Juicessh might not have this function, but plain vanilla openssh allow you to connect with a key rather than a password. Google for "ssh logon key" or similar; http://linuxproblem.org/art_9.html has instructions that look good.

Once you have set up your keys on server and client, no password is needed anymore.

Thanks,you help me a lot. it works well.

padeen 12-17-2013 08:42 PM

For other readers not in an Android environment, you could use the "expect" package to provide the same functionality as typing the password ahead (which ssh will not let you do). However, using a key is much better practice.


All times are GMT -5. The time now is 03:57 AM.