root アカウントを使用して多数のサーバーにいくつかの公開鍵をプッシュしようとしていますが、これらの新しい鍵を「postgres」ユーザーの下に置きたいと考えています。
私はこれをやっています:
$ cat new_dba_keys.pub | ssh -l root 10.224.1.16 "su - postgres |cat >> ~/.ssh/authorized_keys"
-bash: line 2: ssh-rsa: command not found
-bash: line 4: ssh-rsa: command not found
ご覧のとおり、機能しません。