improve ssh speed during testing
This commit is contained in:
@ -18,6 +18,15 @@ if ! [ -e /root/.ssh/id_rsa ]; then
|
|||||||
ssh -oStrictHostKeyChecking=no localhost true || exit 1
|
ssh -oStrictHostKeyChecking=no localhost true || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cat >> ~/.ssh/config <<EOF
|
||||||
|
Host *
|
||||||
|
addkeystoagent yes
|
||||||
|
controlpath ~/.ssh/control-master-%r@%h:%p
|
||||||
|
controlmaster auto
|
||||||
|
controlpersist 3600
|
||||||
|
EOF
|
||||||
|
|
||||||
|
|
||||||
modprobe brd rd_size=512000
|
modprobe brd rd_size=512000
|
||||||
|
|
||||||
umount /tmp/ZfsCheck*
|
umount /tmp/ZfsCheck*
|
||||||
|
|||||||
@ -4,8 +4,13 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
if ! [ -e /.dockerenv ]; then
|
||||||
|
echo "only run this script inside a docker container!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if ! [ -e /dev/ram0 ]; then
|
if ! [ -e /dev/ram0 ]; then
|
||||||
echo "Please run this outside container:" >&2
|
echo "Please load this module outside container:" >&2
|
||||||
echo "sudo modprobe brd rd_size=512000" >&2
|
echo "sudo modprobe brd rd_size=512000" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
@ -16,11 +21,21 @@ ssh-keygen -A
|
|||||||
/usr/sbin/sshd
|
/usr/sbin/sshd
|
||||||
udevd -d
|
udevd -d
|
||||||
|
|
||||||
#test ssh localhost
|
|
||||||
|
#config ssh
|
||||||
if ! [ -e /root/.ssh/id_rsa ]; then
|
if ! [ -e /root/.ssh/id_rsa ]; then
|
||||||
ssh-keygen -t rsa -f /root/.ssh/id_rsa -P ''
|
ssh-keygen -t rsa -f /root/.ssh/id_rsa -P ''
|
||||||
fi
|
fi
|
||||||
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
|
|
||||||
|
cat >> ~/.ssh/config <<EOF
|
||||||
|
Host *
|
||||||
|
addkeystoagent yes
|
||||||
|
controlpath ~/.ssh/control-master-%r@%h:%p
|
||||||
|
controlmaster auto
|
||||||
|
controlpersist 3600
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
|
||||||
ssh -oStrictHostKeyChecking=no localhost 'echo SSH OK'
|
ssh -oStrictHostKeyChecking=no localhost 'echo SSH OK'
|
||||||
|
|
||||||
cd /app
|
cd /app
|
||||||
|
|||||||
Reference in New Issue
Block a user