-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
71 lines (59 loc) · 1.89 KB
/
setup.sh
File metadata and controls
71 lines (59 loc) · 1.89 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
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
apt-get --quiet update;
apt-get --quiet -y install screen emacs git python mlocate openmpi-bin openmpi-doc libopenmpi-dev make valgrind g++ m4 gfortran liblapacke-dev libnetcdf-dev iputils-ping openssh-server cmake mesa-utils-extra
if [ ! -f /etc/hosts.DIST ]
then
cp /etc/hosts /etc/hosts.DIST
fi
if ! id subflow >/dev/null 2>&1
then
groupadd subflow; useradd -g subflow -d /home/subflow -m -c 'Subflow Execution' -s /bin/bash subflow
fi
if [ ! -f /root/.ssh/id_rsa.pub ]
then
echo -e 'y\n'|/usr/bin/ssh-keygen -f /root/.ssh/id_rsa -t rsa -N ''
fi
c=`grep -c "HostbasedAuthentication yes" /etc/ssh/ssh_config`
if [ "$c" -eq "0" ]
then
echo "Enable SSH client HostbasedAuthentication"
echo "HostbasedAuthentication yes" >> /etc/ssh/ssh_config
fi
c=`grep -c "HostbasedAuthentication yes" /etc/ssh/sshd_config`
if [ "$c" -eq "0" ]
then
echo "Enable SSH server HostbasedAuthentication"
echo "HostbasedAuthentication yes" >> /etc/ssh/sshd_config
fi
c=`grep -c "IgnoreRhosts no" /etc/ssh/sshd_config`
if [ "$c" -eq "0" ]
then
echo "Enable SSH server rhosts authentication"
echo "IgnoreRhosts no" >> /etc/ssh/sshd_config
fi
c=`grep -c "HostbasedUsesNameFromPacketOnly yes" /etc/ssh/sshd_config`
if [ "$c" -eq "0" ]
then
echo "Enable SSH server HostbasedUsesNameFromPacketOnly"
echo "HostbasedUsesNameFromPacketOnly yes" >> /etc/ssh/sshd_config
fi
c=`grep -c "^PermitRootLogin yes" /etc/ssh/sshd_config`
if [ "$c" -eq "0" ]
then
echo "Enable SSH server root login"
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
fi
cp /etc/hosts.DIST /etc/hosts
rm -f /etc/ssh/shosts.equiv /etc/mpihostfile
while [[ $# -gt 0 ]]
do
echo "$1 $2" >> /etc/hosts
echo "$2" >> /etc/ssh/shosts.equiv
echo "$2 slots=$3 max-slots=$3" >> /etc/mpihostfile
shift
shift
shift
done
cp /etc/ssh/shosts.equiv /root/.rhosts
/etc/init.d/ssh stop
/etc/init.d/ssh start