OpenSecurity/bin/create-cert-and-iso.sh
author Oliver Maurhart <oliver.maurhart@ait.ac.at>
Wed, 29 Oct 2014 15:18:22 +0100
changeset 240 d7ef04254e9c
parent 53 01839f13cef3
permissions -rwxr-xr-x
lizenz fixed in all files
dyle@53
     1
#!/bin/sh
dyle@53
     2
oliver@240
     3
# ------------------------------------------------------------
oliver@240
     4
# create-and-iso
oliver@240
     5
#
oliver@240
     6
# shell script to create SSH key pairs and place them inisde an ISO image
oliver@240
     7
#
oliver@240
     8
# Copyright 2013-2014 X-Net and AIT Austrian Institute of Technology
oliver@240
     9
# 
oliver@240
    10
# 
oliver@240
    11
#     X-Net Services GmbH
oliver@240
    12
#     Elisabethstrasse 1
oliver@240
    13
#     4020 Linz
oliver@240
    14
#     AUSTRIA
oliver@240
    15
#     https://www.x-net.at
oliver@240
    16
# 
oliver@240
    17
#     AIT Austrian Institute of Technology
oliver@240
    18
#     Donau City Strasse 1
oliver@240
    19
#     1220 Wien
oliver@240
    20
#     AUSTRIA
oliver@240
    21
#     http://www.ait.ac.at
oliver@240
    22
# 
oliver@240
    23
# 
oliver@240
    24
# Licensed under the Apache License, Version 2.0 (the "License");
oliver@240
    25
# you may not use this file except in compliance with the License.
oliver@240
    26
# You may obtain a copy of the License at
oliver@240
    27
# 
oliver@240
    28
#    http://www.apache.org/licenses/LICENSE-2.0
oliver@240
    29
# 
oliver@240
    30
# Unless required by applicable law or agreed to in writing, software
oliver@240
    31
# distributed under the License is distributed on an "AS IS" BASIS,
oliver@240
    32
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
oliver@240
    33
# See the License for the specific language governing permissions and
oliver@240
    34
# limitations under the License.
dyle@53
    35
# and create a ISO image with it
oliver@240
    36
# ------------------------------------------------------------
dyle@53
    37
dyle@53
    38
VM_NAME=$(basename "$(pwd)")
dyle@53
    39
echo ${VM_NAME}
dyle@53
    40
dyle@53
    41
mkdir .ssh &> /dev/null
dyle@53
    42
ssh-keygen -q -t rsa -N "" -C "${VM_NAME}" -f dvm_key &> /dev/null
dyle@53
    43
chmod 500 dvm_key
dyle@53
    44
mv dvm_key.pub .ssh/authorized_keys
dyle@53
    45
genisoimage -J -R -o "${VM_NAME}.iso" .ssh
dyle@53
    46