Update setup.sh

This commit is contained in:
12nick12 2018-06-05 16:58:07 -04:00 committed by GitHub
parent c10f839ec9
commit 4beb920c51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,7 @@
#!/bin/bash
serverport=22333
host=$(hostname)
ip=$(curl -s https://canihazip.com/s)
port=$(shuf -i 9151-49151 -n 1)
@ -10,7 +12,7 @@ ssh-keygen -t rsa -f $dir/id_rsa -q -N ""
chmod 400 $dir/id_rsa*
cat $dir/id_rsa.pub | ssh -p port root@remotehost.com "mkdir -p ~/.ssh; chmod 700 ~/.ssh; cat >> ~/.ssh/authorized_keys"
cat $dir/id_rsa.pub | ssh -p $serverport root@remotehost.com "mkdir -p ~/.ssh; chmod 700 ~/.ssh; cat >> ~/.ssh/authorized_keys"
sqlite3 $dir/sshjump.db 'create table sshjump(host, ip, port, id);'