-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitialize.sh
More file actions
executable file
·58 lines (39 loc) · 1.28 KB
/
initialize.sh
File metadata and controls
executable file
·58 lines (39 loc) · 1.28 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bash
## path:
ROOT_PATH=$(dirname $BASH_SOURCE);
## chmod for all id_rsa*
chmod 600 id_rsa*
## for single:
sudo chmod 600 ~/.ssh/id_rsa;
sudo chmod 600 ~/.ssh/id_rsa.pub;
# sudo chmod 644 ~/.ssh/known_hosts;
sudo chmod 755 ~/.ssh;
## ssh-copy-id
# ssh-copy-id root@118.178.20.114
# ssh-copy-id root@139.224.18.91
## create ssh_pubkey for every git site:
cp $ROOT_PATH/.ssh/config ~/.ssh/;
chmod 600 ~/.ssh/config;
##create id_rsa
ssh-keygen
##create oschina:
ssh-keygen -t rsa -f ~/.ssh/id_rsa.oschina.net -C "Key for git.oschina.net";
##create github:
ssh-keygen -t rsa -f ~/.ssh/id_rsa.github.com -C "Key for git.github.com";
##create git.zaijiadd.com:
# ssh-keygen -t rsa -f ~/.ssh/id_rsa.zaijiadd.com -C "Key for git.zaijiadd.com";
##create gitlab.finxos.com
# ssh-keygen -t rsa -f ~/.ssh/id_rsa.gitlab.finxos.com -C "Key for gitlab.finxos.com";
## create for saybot
# ssh-keygen -t rsa -f ~/.ssh/id_rsa.saybot.net -C "Key for git.saybot.net";
##add to cache:
ssh-add ~/.ssh/id_rsa.oschina.net;
ssh-add ~/.ssh/id_rsa.github.com;
# ssh-add ~/.ssh/id_rsa.zaijiadd.com;
# ssh-add ~/.ssh/id_rsa.gitlab.finxos.com;
##Test git config:
# ssh -T git@git.oschina.net;
# ssh -T git@github.com;
# ssh -T git@git.zaijiadd.com;
# ssh -T git@gitlab.finxos.com;
# ssh -T git@git.saybot.net