-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetupSSHKeys.sh
More file actions
39 lines (28 loc) · 1.03 KB
/
setupSSHKeys.sh
File metadata and controls
39 lines (28 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
set -x
# Quick script to set up SSH-keys on all the machines
# Change password on all the machines
passwd
ssh -t chewie-local passwd
ssh -t luke-local passwd
ssh -t han-local passwd
# Set up key on ben
ssh-keygen -q -t rsa -N '' <<< ""$'\n'"y" 2>&1 >/dev/null
ssh-copy-id chewie-local
ssh-copy-id luke-local
ssh-copy-id han-local
# Set up key on chewie
ssh -t chewie-local "ssh-keygen -q -t rsa -N '' <<< \"\"$'\n'\"y\" 2>&1 >/dev/null"
ssh -t chewie-local "ssh-copy-id ben-local"
ssh -t chewie-local "ssh-copy-id luke-local"
ssh -t chewie-local "ssh-copy-id han-local"
# Set up key on luke
ssh -t luke-local "ssh-keygen -q -t rsa -N '' <<< \"\"$'\n'\"y\" 2>&1 >/dev/null"
ssh -t luke-local "ssh-copy-id ben-local"
ssh -t luke-local "ssh-copy-id chewie-local"
ssh -t luke-local "ssh-copy-id han-local"
# Set up key on han
ssh -t han-local "ssh-keygen -q -t rsa -N '' <<< \"\"$'\n'\"y\" 2>&1 >/dev/null"
ssh -t han-local "ssh-copy-id ben-local"
ssh -t han-local "ssh-copy-id chewie-local"
ssh -t han-local "ssh-copy-id luke-local"