File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,9 @@ elif [[ "$1" == "--as-listener--" ]] ; then
53
53
# remember processid to be able kill it
54
54
nc_procid=$!
55
55
56
+ # protect socket and log file from reading
57
+ chmod 0700 $listener_socket $listener_socket .log
58
+
56
59
# remove netcat listening on socket
57
60
trap " kill -SIGINT $nc_procid >/dev/null 2>&1; rm -f $listener_socket .log" 0 1 2 3 6
58
61
@@ -158,16 +161,15 @@ else
158
161
159
162
listener_processid=$!
160
163
161
- # start ssh
164
+ # by the exit kill listener and remove temporary files
165
+ trap " kill -SIGINT $listener_processid > /dev/null 2>&1; rm -f $listener_local $listener_local .log $listener_remote $root_socket " 0 1 2 3 6
166
+
167
+ # starting ssh
162
168
163
169
if [[ " x$ssh_command " == " x" ]] ; then
164
170
ssh_command=" \$ SHELL"
165
171
fi
166
172
167
- # by the exit kill listener and remove temporary files
168
- trap " kill -SIGINT $listener_processid > /dev/null 2>&1; rm -f $listener_local $listener_local .log $listener_remote $root_socket " 0 1 2 3 6
169
-
170
-
171
173
ssh -t -R $listener_remote :$listener_local -L $localport :$root_socket $ssh_destination $ssh_args \
172
174
" chmod 0700 $listener_remote ; export ROOT_WEBDISPLAY=server; export ROOT_LISTENER_SOCKET=$listener_remote ; export ROOT_WEBGUI_SOCKET=$root_socket ; $ssh_command ; rm -f $listener_remote $root_socket "
173
175
You can’t perform that action at this time.
0 commit comments