-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathssh_socks.sh
More file actions
executable file
·49 lines (43 loc) · 1.75 KB
/
Copy pathssh_socks.sh
File metadata and controls
executable file
·49 lines (43 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
#################################################################
# For establishing a SOCKS connection via SSH. #
# #
# Author: Maximilian Stiefel #
# Last modified: 15. April 2017 #
# CLI usage: ./ssh_socks.sh user@server.com remote_port #
# Required PKGs: ssh, firefox #
# #
#################################################################
#################################################################
# Vars #
#################################################################
# Exctracting username@server.com
USER_SERVER="$1"
# Extracting port at server.com for SSH
PORT="$2"
# Command to execute
MYCMD1="ssh -C2TnN -D 8080 -p $PORT $USER_SERVER"
# Expected number of params
NU_PARAMS=2;
#################################################################
# Action #
#################################################################
# Check if the expected number of parameters is given.
if (( $# != $NU_PARAMS )); then
echo "Error: Illegal number of parameters."
echo "Correct usage is:"
echo "./ssh_socks.sh user@server.com remote_port"
exit 1;
fi
echo "####################################################"
echo "Connecting to server. Leave shell open ;)"
echo "####################################################"
echo ""
echo "####################################################"
echo "Firefox Configuration:"
echo "----------------------"
echo "Advanced->Network->Connection Settings"
echo "->SOCKS->Host: 127.0.0.1->Port: 8080"
echo "####################################################"
echo "$MYCMD1"
$MYCMD1