diff --git a/src/ssh-backdoor b/src/ssh-backdoor index d0692a5..6a1803a 100755 --- a/src/ssh-backdoor +++ b/src/ssh-backdoor @@ -104,6 +104,14 @@ def setup_options(): type = str, help="Id name for backdoor" ) + parser_wait.add_argument( + action = 'store', + dest = 'port', + type = int, + default = None, + nargs = '?', + help="The port given earlier. Can check against DB" + ) options=parser.parse_args() if options.command == None: parser.print_help(sys.stderr) @@ -361,6 +369,10 @@ if __name__ == "__main__": if opts.command == "keep": print(db.update(opts.id)) + reverseport = db.get_port('reverseport',opts.id) + if opts.port != reverseport: + ewrite(" Need to refresh port\r") + sys.exit(0) ewrite( " Connected\r" ) diff --git a/src/ssh-backdoor-open b/src/ssh-backdoor-open index ac2d045..ababc69 100755 --- a/src/ssh-backdoor-open +++ b/src/ssh-backdoor-open @@ -53,7 +53,7 @@ while true; do #~ _ssh pkill -a -f $USER@$HOSTNAME _autossh \ -R $reverseport:localhost:22 \ - bin/ssh-backdoor keep $USER@$HOSTNAME + bin/ssh-backdoor keep $USER@$HOSTNAME $reverseport for i in {1..10}; do sleep 1