Re: Question about ssh no login



I demand that sk8terg1rl may or may not have written...

I've implemented ssh no logins between 2 computers. Basically it involved
generating a public & private key pair with no passphrase and appending the
public keys to "authorized_hosts2" in the ".ssh" folder for either machine.

How do I run commands in the remote machine from the local machine's bash?

You don't.

I tried a simple script on the local machine containing "ssh
remotemachine@xxxxxxxxxxxxxxx; ls; exit". It logs in fine but ignores
the rest of the script.

Wrong - the rest of the script will be executed on the local machine when
that ssh instance is terminated.

You mean this:
ssh remotemachine@xxxxxxxxxxxxxxx ls

--
| Darren Salt | linux or ds at | nr. Ashington, | Toon
| RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
| + Output *more* particulate pollutants. BUFFER AGAINST GLOBAL WARMING.

Confucius say: He who post large binary, get flamed.
.



Relevant Pages

  • Re: SSH login automation, get stuck at the last step.
    ... I hope you managed to create the keys with the script. ... I have modified Uwe's script to handle passphrase. ... puts stderr "EXP username requested and sent " ...
    (comp.lang.tcl)
  • Re: scp and scripts?
    ... The following is basically what I want the script to do, ... >> but I heard scp will not work with authentication. ... > an SSH key of the appropriate type. ... > want a passphrase; press enter to use a blank passphrase. ...
    (Debian-User)
  • Re: scp in a script with keys and passphrase
    ... Expect can automate task of typing passphrase in a expect script - but ask yourself a question what good is the passphrase if you have to store it in clear text? ... scp in a script with keys and passphrase ... Expect is a tcl extension for automating interactive applications such ...
    (RedHat)
  • RE: scp in a script with keys and passphrase
    ... the "expect" package may be what you're looking for. ... Expect is a tcl extension for automating interactive applications such ... scp in a script with keys and passphrase ... passphrase in a script to scp from one computer to another. ...
    (RedHat)
  • Simple expect script has erratic behavior, why?
    ... I have a simple expect script to decrypt a gpg file when passed the ... passphrase on the command line. ... If I run the gpg command from the command line, ...
    (comp.lang.tcl)