summaryrefslogtreecommitdiff
path: root/port-forward
diff options
context:
space:
mode:
Diffstat (limited to 'port-forward')
-rwxr-xr-xport-forward/rm_all_ssh_connections.sh4
-rwxr-xr-xport-forward/ssh-port-forward.sh2
2 files changed, 6 insertions, 0 deletions
diff --git a/port-forward/rm_all_ssh_connections.sh b/port-forward/rm_all_ssh_connections.sh
new file mode 100755
index 0000000..f19300d
--- /dev/null
+++ b/port-forward/rm_all_ssh_connections.sh
@@ -0,0 +1,4 @@
1#!/bin/bash
2ss -tnp | grep ':22'
3ps -ef | grep sshd | grep -v grep | awk '{if($3!=1) print $2}' | xargs kill
4#sudo systemctl restart sshd
diff --git a/port-forward/ssh-port-forward.sh b/port-forward/ssh-port-forward.sh
index b549560..4483ef4 100755
--- a/port-forward/ssh-port-forward.sh
+++ b/port-forward/ssh-port-forward.sh
@@ -1,5 +1,7 @@
1#!/bin/bash 1#!/bin/bash
2 2
3# opens 5 ports
4
3#file will be run from where the user executes the script 5#file will be run from where the user executes the script
4j=$1 6j=$1
5HOST="root@p.0nom.ch" 7HOST="root@p.0nom.ch"