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

Initial implementation, further testing is needed.

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