#!/bin/sh ssh -vvv root@localhost echo "hello world" >/tmp/ssh.out 2>&1 echo rc: $? >>/tmp/ssh.out