X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=sim%2Fo1-interface.git;a=blobdiff_plain;f=ntsimulator%2Fdeploy%2Ftls%2Fenable_tls.sh;h=97ba4c229e20887e70b1356703aff580a378cba8;hp=11fbb3dafc950a642320b8786930326ad7dd2e0a;hb=048a8673d15e0329cd79594028f19ba315ba7140;hpb=7dbf479029ba8bc528fb61a40ab2647489da28e9 diff --git a/ntsimulator/deploy/tls/enable_tls.sh b/ntsimulator/deploy/tls/enable_tls.sh index 11fbb3d..97ba4c2 100755 --- a/ntsimulator/deploy/tls/enable_tls.sh +++ b/ntsimulator/deploy/tls/enable_tls.sh @@ -24,6 +24,24 @@ openssl genrsa -out melacon.server.key 2048 openssl req -new -sha256 -key melacon.server.key -subj "/C=US/ST=CA/O=MeLaCon, Inc./CN=melacon.com" -out melacon.server.csr openssl x509 -req -in melacon.server.csr -CA ca.pem -CAkey ca.key -CAcreateserial -out melacon.server.crt -days 500 -sha256 rm melacon.server.csr +ssh-keygen -y -f melacon.server.key > melacon.server.key.pub + +SSH_PUB_KEY="$(cat /home/netconf/.ssh/id_dsa.pub| awk '{print $2}')" +SSH_PUB_KEY_MELACON="$(cat melacon.server.key.pub | awk '{print $2}')" + +echo 'netconf' >> load_auth_pubkey.xml +echo 'ssh_keyssh-dss' >> load_auth_pubkey.xml +echo ''"$SSH_PUB_KEY"'' >> load_auth_pubkey.xml +echo 'melacon_server_keyssh-rsa' >> load_auth_pubkey.xml +echo ''"$SSH_PUB_KEY_MELACON"'' >> load_auth_pubkey.xml + +sysrepocfg --merge=load_auth_pubkey.xml --format=xml ietf-system +rm load_auth_pubkey.xml + +if [ $IPv6Enabled = "true" ]; then + ssh-keyscan -p 830 :: >> ~/.ssh/known_hosts +fi +ssh-keyscan -p 830 127.0.0.1 >> /root/.ssh/known_hosts MELACON_SERVER_KEY="$(sed '1d;$d' melacon.server.key)"