Vetinari's $HOME

Using OpenSSH public keys with an SSH Server

 client$ ssh-keygen -t dsa -f ~/.ssh/id_dsa.com
 client$ ssh-keygen -e -f ~/.ssh/id_dsa.com.pub > ~/.ssh/id_dsa.com.pub.tmp
 client$ mv ~/.ssh/id_dsa.com.pub.tmp ~/.ssh/id_dsa.com.pub
 client$ sftp server.domain.com
 sftp> cd .ssh2
 sftp> put id_dsa.com.pub id_home.pub
 sftp> quit
 client$ cat >> .ssh/config

 Host server
    HostName server.domain.com
    User username
    # Port 2222
    Port 22
    IdentityFile ~/.ssh/id_dsa.com

 ^D
 client$ ssh server 'echo "Key id_home.pub" >> .ssh2/authorization; chmod 600 .ssh2/*'
 client$ ssh server
 server$

Switch stderr and stdout in sh

 #!/bin/sh
 
 err=`( echo error 1>&2 ; echo out ) 3>&1 1>&2 2>&3 3>&1`
 echo "ERROR: '$err'"