Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Oct 07, 2011 10:13 am 
Offline
Newbie

Joined: Fri Oct 07, 2011 10:02 am
Posts: 3
On my desktop I'd like to run a script on my Linode using SSH. The script is called mydesktopscript, which contains the following:

Code:
ssh linode******@london***.linode.com "/usr/local/bin/mylinodescript arg1 arg2"


Where linode******@london***.linode.com is the SSH command to enter Lish on the Linode. So basically I want to run mylinodescript on my Linode. I don't need to enter a password when I run the above command, because I use Lish via SSH Keys, so the SSH login happens automatically.

However, when I run it on my desktop I get the following error:

Code:
Unknown command '/usr/local/bin/mylinodescript arg1 arg2'


Even if I replace the command with "echo hi", I get:

Code:
Unknown command 'echo hi'


What am I doing wrong? Also, I need to log in via Lish and not via regular SSH into the Linode, because this script has to do with recovery situations where we cannot log in via regular SSH. Any help you could provide would be great, thanks.


Top
   
 Post subject:
PostPosted: Fri Oct 07, 2011 10:45 am 
Offline
Senior Member
User avatar

Joined: Tue Jan 04, 2005 7:32 am
Posts: 277
Website: http://www.betadome.com/
Location: Ă…lesund, Norway
Skype: neonnero
Twitter: neonnero
You would have to do this in two separate operations. When you log in to LiSH, it's a limited shell that opens up the "screen" software to your virtual console. You can't use LiSH in the exact same manner as you would with an SSH connection.


Top
   
 Post subject:
PostPosted: Fri Oct 07, 2011 10:54 am 
Offline
Newbie

Joined: Fri Oct 07, 2011 10:02 am
Posts: 3
Thanks for the response. Could you by any chance provide an example of how I could do it from my remote system, even if with 2 separate operations? Thanks.


Top
   
 Post subject:
PostPosted: Fri Oct 07, 2011 12:33 pm 
Offline
Senior Member
User avatar

Joined: Thu Jun 16, 2011 8:24 am
Posts: 412
Location: Cyberspace
I haven't tried this (and I can't until I get to a computer), but one idea is to connect to lish normally via ssh, then from there log into your Linode, and close your terminal. Since lish is basically screen, your login to your Linode will stay open. From there, you can try passing your command via < and >, e.g. "./script > ssh ...".

It would be easier to place your public key directly on your Linode and execute the command that way. Unless you corrupt you Linode's ssh server, there shouldn't be a need to go through lish since it's intended as a backup for ssh.

_________________
Kris the Piki Geeker


Top
   
 Post subject:
PostPosted: Sat Oct 08, 2011 2:40 pm 
Offline
Senior Newbie

Joined: Sat Sep 03, 2011 10:01 am
Posts: 17
you don't need to do it via lish.
if you have ssh server running on your node, just establish ssh session directly to the node and not to the console.

The very first link in google search : https://hkn.eecs.berkeley.edu/~dhsu/ssh_public_key_howto.html


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group