LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 09: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-16-2013, 11:00 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
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, 01: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, 08:42 PM   #4
padeen
Member
 
Registered: Sep 2009
Location: Perth, W.A.
Distribution: Slackware, Debian, Gentoo, FreeBSD, OpenBSD
Posts: 208

Rep: Reputation: 41
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



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 12:17 AM
automatically run command in terminal after x minutes of idle time. williantalvane Linux - General 3 02-21-2013 11:21 PM
Dedicated Server Run Terminal all the time stuartmunro Linux - Newbie 6 07-24-2005 03:38 PM
terminal -> codes aap Linux - Newbie 13 02-05-2005 12:52 PM
ssh-keygen run time fatman Linux - Software 5 01-11-2004 12:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:28 PM.

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
Open Source Consulting | Domain Registration