Page Actions
Wiki Actions
User Actions
Submit This Story

Do ssh-copy-id to Restricted Shells

Recently I have the need to ssh into some machine running “Restricted Shell” of IBM products, like restricted Bash for HMC and ksh for VIOS.
The handy “ssh-copy-id” won't work cos no cd and redirection is alloewd. But it is still do-able with a lil'bit manual labor.

The Solution

Just use scp to get this done:

#!/bin/sh
# Append ssh pub key to IBM restricted shells, like hmc and vios
# Suppose entry exist on .ssh/config
scp $1:.ssh/authorized_keys2 ~/.ssh/tmp_key_$1
cat ~/.ssh/id_rsa.pub >> ~/.ssh/tmp_key_$1
scp ~/.ssh/tmp_key_$1 $1:.ssh/authorized_keys2

The tricky thing is that pub key filename is “authorized_keys2”. Maybe to avoid some stupid scanner…

Discussion

Enter your comment
 
 
blog/2011/08/ssh-copy-id_in_rksh.txt · Last modified: 2011/08/30 22:55 by MeaCulpa     Back to top
Recent changes RSS feed Creative Commons License Powered by PHP Driven by DokuWiki