add first version of remote access
This commit is contained in:
parent
2a2ca591be
commit
c1ce7d16e0
1 changed files with 59 additions and 0 deletions
59
remote-access.sh
Executable file
59
remote-access.sh
Executable file
|
|
@ -0,0 +1,59 @@
|
|||
#!/bin/sh
|
||||
# Nico Schottelius, 2026-05-26
|
||||
|
||||
if [ $# -ne 1 ] ; then
|
||||
echo $0 hostname.ra.placeX.ungleich.ch
|
||||
exit 1
|
||||
fi
|
||||
|
||||
target_host=$1; shift
|
||||
|
||||
case $target_host in
|
||||
*.ra.place10.ungleich.ch)
|
||||
jump="vigir26.place10.ungleich.ch"
|
||||
#jump="vigir26.place10.ungleich.ch vigir23.place10.ungleich.ch"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported RA access" >&2
|
||||
exit 1
|
||||
esac
|
||||
|
||||
set -x
|
||||
|
||||
if ! docker ps --format '{{.Names}}' | grep -q "^old-firefox$"; then
|
||||
echo "Starting old firefox in docker in background"
|
||||
docker run -ti --rm --net=host --name old-firefox -d \
|
||||
-v ~/.old-firefox:/root/.mozilla ungleich/firefox-java-vnc
|
||||
else
|
||||
echo "Old firefox already running"
|
||||
fi
|
||||
|
||||
echo "Trying to create socks proxy on localhost:3133 (might fail if running already)"
|
||||
for jhost in $jump; do
|
||||
if ping -c2 $jhost; then
|
||||
ssh -D 3133 -f -N -T root@$jhost
|
||||
if [ $? -eq 0 ]; then break; fi
|
||||
fi
|
||||
done
|
||||
|
||||
docker exec -d old-firefox firefox $target_host
|
||||
|
||||
vncviewer localhost:0
|
||||
|
||||
cat <<EOF
|
||||
Remote access has been setup. To access it, do:
|
||||
|
||||
- Configure firefox to use a proxy, type SOCKS, port 3133
|
||||
- To cleanup:
|
||||
docker rm -f old-firefox
|
||||
|
||||
Typical usernames:
|
||||
|
||||
- Supermicro: ADMIN
|
||||
- ilo3: Administrator
|
||||
- drac 6: root
|
||||
|
||||
Password: placeX/remote-management
|
||||
|
||||
|
||||
EOF
|
||||
Loading…
Add table
Add a link
Reference in a new issue