mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08:00
Show tmate.conf settings when generating keys
This commit is contained in:
parent
b657cdf1e9
commit
7c0ab369df
@ -1,13 +1,27 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -eu
|
||||||
|
|
||||||
gen_key() {
|
gen_key() {
|
||||||
keytype=$1
|
keytype=$1
|
||||||
ks="${keytype}_"
|
ks="${keytype}_"
|
||||||
key="keys/ssh_host_${ks}key"
|
key="keys/ssh_host_${ks}key"
|
||||||
if [ ! -e "${key}" ] ; then
|
if [ ! -e "${key}" ] ; then
|
||||||
ssh-keygen -t ${keytype} -f "${key}" -N ''
|
ssh-keygen -t ${keytype} -f "${key}" -N ''
|
||||||
return $?
|
SIG=$(ssh-keygen -l -E SHA256 -f $key.pub | cut -d ' ' -f 2)
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
mkdir -p keys
|
mkdir -p keys
|
||||||
gen_key rsa && gen_key ed25519 || exit 1
|
gen_key rsa
|
||||||
|
RSA_SIG=$SIG
|
||||||
|
gen_key ed25519
|
||||||
|
ED25519_SIG=$SIG
|
||||||
|
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "You may use the following settings this in your .tmate.conf:"
|
||||||
|
echo ""
|
||||||
|
echo "set -g tmate-server-host localhost"
|
||||||
|
echo "set -g tmate-server-port 22"
|
||||||
|
echo "set -g tmate-server-rsa-fingerprint \"$RSA_SIG\""
|
||||||
|
echo "set -g tmate-server-ed25519-fingerprint \"$ED25519_SIG\""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user