This repository was archived by the owner on Mar 4, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -94,3 +94,25 @@ update-locale
94
94
# ## enable apache2 as a webserver
95
95
dev_scripts=" $drupal_dir /profiles/btr_client/dev"
96
96
$dev_scripts /webserver.sh apache2
97
+
98
+ # ## customize the configuration of sshd
99
+ sed -i /etc/ssh/sshd_config \
100
+ -e ' s/^Port/#Port/' \
101
+ -e ' s/^PasswordAuthentication/#PasswordAuthentication/' \
102
+ -e ' s/^X11Forwarding/#X11Forwarding/'
103
+
104
+ sed -i /etc/ssh/sshd_config \
105
+ -e ' /^### custom config/,$ d'
106
+
107
+ sshd_port=${sshd_port:- 2201}
108
+ cat << EOF >> /etc/ssh/sshd_config
109
+ ### custom config
110
+ Port $sshd_port
111
+ PasswordAuthentication no
112
+ X11Forwarding no
113
+ EOF
114
+
115
+ # ## generate public/private keys for ssh
116
+ mkdir ~ /.ssh
117
+ chmod 700 ~ /.ssh
118
+ ssh-keygen -t rsa -f ~ /.ssh/id_rsa -q -N ' '
Original file line number Diff line number Diff line change @@ -29,3 +29,9 @@ oauth2_client_secret='0123456789'
29
29
30
30
# ## Install also extra things that are useful for development.
31
31
development=' true'
32
+
33
+ # ## Login through ssh.
34
+ # ## Only login through private keys is allowed.
35
+ # ## See also this:
36
+ # ## http://dashohoxha.blogspot.com/2012/08/how-to-secure-ubuntu-server.html
37
+ sshd_port=2201
You can’t perform that action at this time.
0 commit comments