Re: Question about ssh no login



sk8terg1rl <sk8terg1rl_2006@xxxxxxxxxxx> writes:

Hi group,

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?

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.

Wwhat rest of the script. YOu told it to run the command
ssh remotemachine@xxxxxxxxxxxxxxx
then when that command is finished to run ls and then when that finishes
exit. Both of those are run on the local machine.

Try
ssh remotemachine@xxxxxxxxxxxxxxx ls
which will do what you want.


Any input please?

Thanks everyone,
skate xx

.



Relevant Pages

  • Scripts using SSH and SSH_ASKPASS
    ... To test SSH scripts you better destroy the control TTY. ... The trick is to run YOUR script on YOUR local ... As for the password relaying command: this needs not be an X command. ... # we read one line from a temporary pipe. ...
    (comp.security.ssh)
  • Re: How to time out a command
    ... > I have a ksh script that calls another utility (command A). ... I once made the following script to do exactly that. ... # Runs a command and kills it, if necessary, after a given timeout. ... # 0<c<127 - job exited with this exit code ...
    (comp.unix.shell)
  • Re: Changing a users password non-interactively?
    ... You need expect and a setpass.expect script which ill add ... exit with a nasty warning. ... # Be careful of the COMMAND and UNDOCMD - they are dependant on your ...
    (comp.unix.aix)
  • Re: Changing a users password non-interactively?
    ... You need expect and a setpass.expect script which ill add ... exit with a nasty warning. ... # Be careful of the COMMAND and UNDOCMD - they are dependant on your ...
    (comp.unix.aix)
  • Re: remote server backup script
    ... > Just type away at the command line. ... Make a backup of whatever you want ... > command line, in a script. ... >>the server ssh key on the clients machine). ...
    (comp.os.linux.misc)