LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-16-2013, 10:20 PM   #1
ytyyutianyun
Member
 
Registered: Nov 2011
Posts: 63

Rep: Reputation: Disabled
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
 
Old 12-17-2013, 12:00 AM   #2
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora
Posts: 1,687

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
Quote:
Originally Posted by ytyyutianyun View Post
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.
 
1 members found this post helpful.
Old 12-17-2013, 02:27 AM   #3
ytyyutianyun
Member
 
Registered: Nov 2011
Posts: 63

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
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.
 
Old 12-17-2013, 09:42 PM   #4
padeen
Member
 
Registered: Sep 2009
Location: Perth, W.A.
Distribution: Slackware 14, Debian Sid, FreeBSD 10, OpenBSD
Posts: 190

Rep: Reputation: 36
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.
 
  


Reply

Tags
snippet, ssh


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] how to open terminal through c program and run another code on it same time rohaanembedded Programming 10 05-30-2013 01:17 AM
automatically run command in terminal after x minutes of idle time. williantalvane Linux - General 3 02-22-2013 12:21 AM
Dedicated Server Run Terminal all the time stuartmunro Linux - Newbie 6 07-24-2005 04:38 PM
terminal -> codes aap Linux - Newbie 13 02-05-2005 01:52 PM
ssh-keygen run time fatman Linux - Software 5 01-11-2004 01:34 PM


All times are GMT -5. The time now is 07:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration