deleted: install_shell/cgroup-d5000-install/42-2014-01-15-062120/README deleted: install_shell/cgroup-d5000-install/42-2014-01-15-062120/install.sh modified: install_shell/cgroup-d5000-install/install.sh modified: install_shell/create_users.sh modified: install_shell/ntpd_cron_patch.sh modified: install_shell/other.sh modified: install_shell/set_network.sh modified: install_shell/set_ssh.sh modified: setup.sh Signed-off-by: Qin Bo <bqin@linx-info.com>
33 lines
819 B
Bash
Executable File
33 lines
819 B
Bash
Executable File
#!/bin/bash
|
|
|
|
. ./check_function.sh
|
|
|
|
|
|
# sshd_config
|
|
SSHD_CONFIG=/etc/ssh/sshd_config
|
|
SSH_CONFIG=/etc/ssh/ssh_config
|
|
|
|
check_config $SSH_CONFIG StrictHostKeyChecking no
|
|
if [ $rtn -eq 1 ]; then
|
|
sed -i '/StrictHostKeyChecking/d' $SSH_CONFIG
|
|
echo 'StrictHostKeyChecking no' >> $SSH_CONFIG
|
|
elif [ $rtn -eq 2 ]; then
|
|
echo 'StrictHostKeyChecking no' >> $SSH_CONFIG
|
|
fi
|
|
|
|
check_config $SSHD_CONFIG IgnoreUserKnownHosts yes
|
|
if [ $rtn -eq 1 ]; then
|
|
sed -i '/IgnoreUserKnownHosts/d' $SSHD_CONFIG
|
|
echo 'IgnoreUserKnownHosts yes' >> $SSHD_CONFIG
|
|
elif [ $rtn -eq 2 ]; then
|
|
echo 'IgnoreUserKnownHosts yes' >> $SSHD_CONFIG
|
|
fi
|
|
|
|
# To create ssh key..
|
|
USERNAME=$1
|
|
|
|
su - root -c "ssh-keygen -t rsa -f ~/.ssh/id_rsa -N ''"
|
|
su - ${USERNAME} -c "ssh-keygen -t rsa -f ~/.ssh/id_rsa -N ''"
|
|
# restart ssh daemon
|
|
#/etc/init.d/sshd restart
|