diff options
Diffstat (limited to 'client/boot-tools/clientstructure/root/importSshKeys.sh')
-rwxr-xr-x | client/boot-tools/clientstructure/root/importSshKeys.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/client/boot-tools/clientstructure/root/importSshKeys.sh b/client/boot-tools/clientstructure/root/importSshKeys.sh new file mode 100755 index 00000000..17a797f8 --- /dev/null +++ b/client/boot-tools/clientstructure/root/importSshKeys.sh @@ -0,0 +1,17 @@ +#!/bin/bash +echo "comprobando directorio .ssh del root" +if [ ! -d /root/.ssh ] +then + echo "creando directorio .ssh 600" + mkdir -p /root/.ssh + chmod 700 /root/.ssh +fi +echo "creando el fichero authorized_keys" +touch /root/.ssh/authorized_keys +chmod 600 /root/.ssh/authorized_keys + +echo "importando la clave publica del servidor OG" +cat /tmp/id_rsa.pub + +[ -f /tmp/id_rsa.pub ] && cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys || echo "no key publica og" +
\ No newline at end of file |