Skip to content
Snippets Groups Projects
Commit 55d19e46 authored by nimrod's avatar nimrod
Browse files

Initial implementation, further testing is needed.

parent 758745e7
Branches
No related tags found
No related merge requests found
...@@ -2,3 +2,6 @@ ...@@ -2,3 +2,6 @@
*~ *~
*.swp *.swp
*.swo *.swo
CA*
users/
hosts/
...@@ -5,7 +5,9 @@ install: ...@@ -5,7 +5,9 @@ install:
chmod 755 /usr/local/bin/ssh-ca chmod 755 /usr/local/bin/ssh-ca
clean: clean:
rm -rf CA CA.pub rm -rf CA CA.pub users hosts
test: clean test: clean
echo Not implemented. ./ssh-ca init
./ssh-ca newuser john
./ssh-ca newhost www
...@@ -7,20 +7,31 @@ usage () { ...@@ -7,20 +7,31 @@ usage () {
} }
init () { init () {
echo Initializing new CA.
mkdir -p hosts users mkdir -p hosts users
ssh-keygen -qf CA -P /dev/null ssh-keygen -qf CA -P "" -C ssh-ca
} }
signuser () { signuser () {
echo Not implemented. echo "Signing user $1 key."
ssh-keygen -s CA -I "$1" -n "$1" "users/$1.pub"
} }
signhost () { signhost () {
echo Not implemented. echo "Signing host $1 key."
ssh-keygen -s CA -I "$1" -h -n "$1" "hosts/$1.pub"
} }
newhost () { newhost () {
echo Not implemented. echo "Creating new host $1 keypair."
ssh-keygen -qf "hosts/$1" -P "" -C "$1"
signhost "$1"
}
newuser () {
echo "Creating new user $1 keypair."
ssh-keygen -qf "users/$1" -P "" -C "$1"
signuser "$1"
} }
if [ $# -lt 1 ] if [ $# -lt 1 ]
...@@ -42,6 +53,9 @@ case "$1" in ...@@ -42,6 +53,9 @@ case "$1" in
newhost) newhost)
newhost "$2" newhost "$2"
;; ;;
newuser)
newuser "$2"
;;
*) *)
usage usage
exit 1 exit 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment