Commits

Andriy Kornatskyy committed 3522b56

Added ssh-copy-id.sh script.

  • Participants
  • Parent commits d4e89a1

Comments (0)

Files changed (1)

File scripts/ssh-copy-id.sh

+#!/usr/sh
+
+check_args()
+{
+    if [ "$#" -eq 0 ] ; then
+        echo Usage $0 user@machine
+        exit 0
+    fi
+}
+
+main()
+{
+    [ ! -f ~/.ssh/id_rsa.pub ] && ssh-keygen -t rsa
+    cat ~/.ssh/id_rsa.pub | ssh $1 \
+        "mkdir -p ~/.ssh; cat >> ~/.ssh/authorized_keys"
+}
+
+check_args $*
+main $1