Make my SSH aliases prefer LAN over Internet but with a single command #32

Open
opened 2024-07-30 20:26:50 +02:00 by Benjamin_Loison · 34 comments

Currently I have two explicit commands for both networks.

I am fine with the idea of having to specify MAC address or on what network is the given computer.

Tracked at Benjamin_Loison/FileZilla/issues/15.

+12

Currently I have two explicit commands for both networks. I am fine with the idea of having to specify MAC address or on what network is the given computer. Tracked at [Benjamin_Loison/FileZilla/issues/15](https://codeberg.org/Benjamin_Loison/FileZilla/issues/15). +12
Author
Owner

Related to #28.

Related to #28.
Author
Owner
Related to [Benjamin_Loison/openssh/issues/37](https://salsa.debian.org/Benjamin_Loison/openssh/-/issues/37).
Author
Owner

This could be used by being temporarily in 4G to test Internet access, notably concerning Benjamin_Loison/openssh/issues/20.

This could be used by being temporarily in 4G to test Internet access, notably concerning [Benjamin_Loison/openssh/issues/20](https://salsa.debian.org/Benjamin_Loison/openssh/-/issues/20).
Author
Owner
After talking about it with the person:
-----BEGIN PGP MESSAGE-----

hF4DTQa9Wom5MBgSAQdAjEk4CAOEN6Gf22csdaJEojX9mxG/Y+Xf8kNWyCx+7How
4jbzJF+RE6rbqw7Ur/5GYXpyzUVihy8cg/Rad59/1UoA4NuMdVUqt0SOkDnPr9rj
0kIBKV4mINiFTilj2lAKymtcFLmcgkUoQuu9QWnekFn1akInDkmd01kclpm3whwV
Oe5K1N5nZCrYVUR1kzbb8Ei8+8w=
=DFzK
-----END PGP MESSAGE-----

Could make a raspberry pi resolver at home but this would shift the problem to it.

Could just make an alias in ~/.bashrc trying to resolve, possibly with a time out of something like 2 seconds, the computer on current network and if not able to, then leverage Internet proxy.

As proposed, DynDNS does not seem to help.

<details> <summary>After talking about it with the person:</summary> ``` -----BEGIN PGP MESSAGE----- hF4DTQa9Wom5MBgSAQdAjEk4CAOEN6Gf22csdaJEojX9mxG/Y+Xf8kNWyCx+7How 4jbzJF+RE6rbqw7Ur/5GYXpyzUVihy8cg/Rad59/1UoA4NuMdVUqt0SOkDnPr9rj 0kIBKV4mINiFTilj2lAKymtcFLmcgkUoQuu9QWnekFn1akInDkmd01kclpm3whwV Oe5K1N5nZCrYVUR1kzbb8Ei8+8w= =DFzK -----END PGP MESSAGE----- ``` </details> Could make a raspberry pi resolver at home but this would shift the problem to it. Could just make an `alias` in `~/.bashrc` trying to resolve, possibly with a time out of something like 2 seconds, the computer on current network and if not able to, then leverage Internet proxy. As proposed, DynDNS does not seem to help.
Author
Owner

On my Fairphone 4 Termux:

alias Benjamin-Loison-HP_ssh='ssh Benjamin-Loison-HP_CENSORED'
time nslookup Benjamin-Loison-HP-Debian
echo $?
Output:
Server:         8.8.8.8
Address:        8.8.8.8#53

** server can't find Benjamin-Loison-HP-Debian: NXDOMAIN


real    0m0.054s
user    0m0.014s
sys     0m0.013s
1

No matter if connected to Cloudflare DNS or not, there is maybe some cache involving a bias.

On my Fairphone 4 Termux: ```bash alias Benjamin-Loison-HP_ssh='ssh Benjamin-Loison-HP_CENSORED' ``` ```bash time nslookup Benjamin-Loison-HP-Debian echo $? ``` <details> <summary>Output:</summary> ``` Server: 8.8.8.8 Address: 8.8.8.8#53 ** server can't find Benjamin-Loison-HP-Debian: NXDOMAIN real 0m0.054s user 0m0.014s sys 0m0.013s 1 ``` </details> No matter if connected to Cloudflare DNS or not, there is maybe some cache involving a bias.
Author
Owner

As get same nslookup output on my flat wifi without Cloudflare DNS.

time ping -c 1 Benjamin-Loison-HP-Debian
echo $?
Output:
PING Benjamin-Loison-HP-Debian.home (192.168.1.XXX) 56(84) bytes of data.
64 bytes from benjamin-loison-hp-debian.home (192.168.1.XXX): icmp_seq=1 ttl=64 time=71.8 ms

--- Benjamin-Loison-HP-Debian.home ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 71.876/71.876/71.876/0.000 ms

real    0m0.119s
user    0m0.000s
sys     0m0.020s
0
As get same `nslookup` output on my flat wifi without Cloudflare DNS. ```bash time ping -c 1 Benjamin-Loison-HP-Debian echo $? ``` <details> <summary>Output:</summary> ``` PING Benjamin-Loison-HP-Debian.home (192.168.1.XXX) 56(84) bytes of data. 64 bytes from benjamin-loison-hp-debian.home (192.168.1.XXX): icmp_seq=1 ttl=64 time=71.8 ms --- Benjamin-Loison-HP-Debian.home ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 71.876/71.876/71.876/0.000 ms real 0m0.119s user 0m0.000s sys 0m0.020s 0 ``` </details>
Author
Owner
ping -c 1 Not-Existing
ping: unknown host Not-Existing
```bash ping -c 1 Not-Existing ``` ``` ping: unknown host Not-Existing ```
Author
Owner
time ping -c 0 Not-Existing
echo $?
Output:
ping: unknown host Not-existing

real    0m0.027s
user    0m0.001s
sys     0m0.014s
2
```bash time ping -c 0 Not-Existing echo $? ``` <details> <summary>Output:</summary> ``` ping: unknown host Not-existing real 0m0.027s user 0m0.001s sys 0m0.014s 2 ``` </details>
Author
Owner

So figuring out if the computer is available on current network seems to take at most about 0m0.119s which is fine.

So figuring out if the computer is available on current network seems to take at most about 0m0.119s which is fine.
Author
Owner

I suspect that if I try to ssh and depending on exit status try with Internet proxy, then it may be bias by possible correct but broken or exited ssh connection. Related to Benjamin_Loison/openssh/issues/39#note_569621.

I suspect that if I try to `ssh` and depending on exit status try with Internet proxy, then it may be bias by possible correct but broken or exited `ssh` connection. Related to [Benjamin_Loison/openssh/issues/39#note_569621](https://salsa.debian.org/Benjamin_Loison/openssh/-/issues/39#note_569621).
Author
Owner
~/.bashrc:
# [Benjamin_Loison/linux/issues/32](https://gitea.lemnoslife.com/Benjamin_Loison/linux/issues/32)
ssh_on_same_network_preferably() {
	sameNetworkAddress=$1
	internetAddress=$2
	if ssh $sameNetworkAddress exit 2> /dev/null
	then
		message='Same network connection'
		reachableAddress=$sameNetworkAddress
	else
		message='Internet proxy'
		reachableAddress=$internetAddress
	fi
	>&2 echo $message
	ssh $reachableAddress "${@:3}"
}

>&2 is to support correctly piping to clipboard.

Maybe it is useful to use ssh ... exit to be more precise instead of ping.

${@:3} source: the Stack Overflow answer 9057392

<details> <summary><code>~/.bashrc</code>:</summary> ```bash # [Benjamin_Loison/linux/issues/32](https://gitea.lemnoslife.com/Benjamin_Loison/linux/issues/32) ssh_on_same_network_preferably() { sameNetworkAddress=$1 internetAddress=$2 if ssh $sameNetworkAddress exit 2> /dev/null then message='Same network connection' reachableAddress=$sameNetworkAddress else message='Internet proxy' reachableAddress=$internetAddress fi >&2 echo $message ssh $reachableAddress "${@:3}" } ``` </details> `>&2` is to support correctly piping to clipboard. Maybe it is useful to use `ssh ... exit` to be more precise instead of `ping`. `${@:3}` source: [the Stack Overflow answer 9057392](https://stackoverflow.com/a/9057392)
Author
Owner

Being compatible with just targeting a given computer, no matter the running OS hostname would be nice.
#28 may help to have an absolute computer address no matter the running OS.

Being compatible with just targeting a given computer, no matter the running OS hostname would be nice. #28 may help to have an absolute computer address no matter the running OS.
Author
Owner

What about other protocols like SCP with scp?

What about other protocols like SCP with `scp`?
Author
Owner
~/.bashrc:
# [Benjamin_Loison/linux/issues/32](https://gitea.lemnoslife.com/Benjamin_Loison/linux/issues/32)
ssh_on_same_network_preferably() {
	sameNetworkAddress=$1
	if ssh $sameNetworkAddress exit 2> /dev/null
	then
		message='Same network connection'
		reachableAddress=$sameNetworkAddress
	else
		message='Internet proxy'
		reachableAddress=${sameNetworkAddress}_other_network
	fi
	>&2 echo $message
	ssh $reachableAddress "${@:2}"
}

For my work laptop:

~/.ssh/config:
Host CENSORED
    Hostname XXX.XXX.XXX.XXX

Host Benjamin-Loison-HP-Debian_other_network
    Hostname localhost
    Port 2224
	Proxyjump CENSORED
ssh_on_same_network_preferably Benjamin-Loison-HP-Debian hostname
Output:
Internet proxy
Benjamin-Loison-HP-Debian

For OverClock3000:

~/.ssh/config:
Host overclock3000_other_network
    HostName CENSORED.lemnoslife.com
ssh_on_same_network_preferably overclock3000 hostname
Output:
Internet proxy
overclock3000
<details> <summary><code>~/.bashrc</code>:</summary> ```bash # [Benjamin_Loison/linux/issues/32](https://gitea.lemnoslife.com/Benjamin_Loison/linux/issues/32) ssh_on_same_network_preferably() { sameNetworkAddress=$1 if ssh $sameNetworkAddress exit 2> /dev/null then message='Same network connection' reachableAddress=$sameNetworkAddress else message='Internet proxy' reachableAddress=${sameNetworkAddress}_other_network fi >&2 echo $message ssh $reachableAddress "${@:2}" } ``` </details> # For my work laptop: <details> <summary><code>~/.ssh/config</code>:</summary> ``` Host CENSORED Hostname XXX.XXX.XXX.XXX Host Benjamin-Loison-HP-Debian_other_network Hostname localhost Port 2224 Proxyjump CENSORED ``` </details> ```bash ssh_on_same_network_preferably Benjamin-Loison-HP-Debian hostname ``` <details> <summary>Output:</summary> ``` Internet proxy Benjamin-Loison-HP-Debian ``` </details> # For OverClock3000: <details> <summary><code>~/.ssh/config</code>:</summary> ``` Host overclock3000_other_network HostName CENSORED.lemnoslife.com ``` </details> ```bash ssh_on_same_network_preferably overclock3000 hostname ``` <details> <summary>Output:</summary> ``` Internet proxy overclock3000 ``` </details>
Author
Owner
Shared for work at https://tchap.gouv.fr/#/room/!VKLBJRaIhzIdNCigmg:agent.education.tchap.gouv.fr/$T8n94GOoEMYNw7jK4SriMssKwhnjRsnhWb4Er7jBnzc.
Author
Owner
Related to [Benjamin_Loison/openssh/issues/53](https://salsa.debian.org/Benjamin_Loison/openssh/-/issues/53).
Author
Owner

To support nickname, may have to write some kind of dict in ~/.bashrc but I do not like this approach. alias should not work I guess, at leats not cleanly.

Current ping is not compatible with nicknames. Could try ssh.

To support nickname, may have to write some kind of dict in `~/.bashrc` but I do not like this approach. `alias` should not work I guess, at leats not cleanly. Current `ping` is not compatible with nicknames. Could try `ssh`.
Author
Owner
time ssh pegasus exit; echo $?
Output:
real	0m0.339s
user	0m0.118s
sys	0m0.011s
0
time ssh fairphone-4-5g -p 8022
echo $?
Output:
ssh: connect to host fairphone-4-5g port 8022: No route to host

real	0m3.119s
user	0m0.005s
sys	0m0.009s
255
time ssh not_existing
echo $?
Output:
ssh: Could not resolve hostname not_existing: Name or service not known

real	0m0.021s
user	0m0.004s
sys	0m0.009s
255

Maybe because in https://livebox in DHCP I assigned an IP to my phone.

time ping -c 1 fairphone-4-5g
echo $?
Output:
PING fairphone-4-5g.home (192.168.1.XXX) 56(84) bytes of data.
From benjamin-loison-framework.home (192.168.1.XXX) icmp_seq=1 Destination Host Unreachable

--- fairphone-4-5g.home ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms


real	0m3.079s
user	0m0.000s
sys	0m0.009s
1
```bash time ssh pegasus exit; echo $? ``` <details> <summary>Output:</summary> ``` real 0m0.339s user 0m0.118s sys 0m0.011s 0 ``` </details> ```bash time ssh fairphone-4-5g -p 8022 echo $? ``` <details> <summary>Output:</summary> ``` ssh: connect to host fairphone-4-5g port 8022: No route to host real 0m3.119s user 0m0.005s sys 0m0.009s 255 ``` </details> ```bash time ssh not_existing echo $? ``` <details> <summary>Output:</summary> ``` ssh: Could not resolve hostname not_existing: Name or service not known real 0m0.021s user 0m0.004s sys 0m0.009s 255 ``` </details> Maybe because in https://livebox in DHCP I assigned an IP to my phone. ```bash time ping -c 1 fairphone-4-5g echo $? ``` <details> <summary>Output:</summary> ``` PING fairphone-4-5g.home (192.168.1.XXX) 56(84) bytes of data. From benjamin-loison-framework.home (192.168.1.XXX) icmp_seq=1 Destination Host Unreachable --- fairphone-4-5g.home ping statistics --- 1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms real 0m3.079s user 0m0.000s sys 0m0.009s 1 ``` </details>
Author
Owner

ssh root@ll works fine.

`ssh root@ll` works fine.
Author
Owner

DuckDuckGo search add ssh timeout.

DuckDuckGo search *add ssh timeout*.
Author
Owner
time ssh -o ConnectTimeout=1 fp4
echo $?
Output:
ssh: connect to host fairphone-4-5g port 8022: Connection timed out

real	0m1.021s
user	0m0.005s
sys	0m0.008s
255

Source: the Stack Overflow answer 5255550

time ssh -o ConnectTimeout=0.5 fp4
Output:
command-line line 0: invalid time value.

real	0m0.009s
user	0m0.005s
sys	0m0.004s
```bash time ssh -o ConnectTimeout=1 fp4 echo $? ``` <details> <summary>Output:</summary> ``` ssh: connect to host fairphone-4-5g port 8022: Connection timed out real 0m1.021s user 0m0.005s sys 0m0.008s 255 ``` </details> Source: [the Stack Overflow answer 5255550](https://stackoverflow.com/a/5255550) ```bash time ssh -o ConnectTimeout=0.5 fp4 ``` <details> <summary>Output:</summary> ``` command-line line 0: invalid time value. real 0m0.009s user 0m0.005s sys 0m0.004s ``` </details>
Author
Owner
time timeout 1 ssh fp4; echo $?
Output:

real	0m1.004s
user	0m0.003s
sys	0m0.007s
124

Source: the Stack Overflow answer 32389925

time timeout 0.5 ssh fp4; echo $?
Output:

real	0m0.505s
user	0m0.005s
sys	0m0.011s
124
```bash time timeout 1 ssh fp4; echo $? ``` <details> <summary>Output:</summary> ``` real 0m1.004s user 0m0.003s sys 0m0.007s 124 ``` </details> Source: [the Stack Overflow answer 32389925](https://stackoverflow.com/a/32389925) ```bash time timeout 0.5 ssh fp4; echo $? ``` <details> <summary>Output:</summary> ``` real 0m0.505s user 0m0.005s sys 0m0.011s 124 ``` </details>
Author
Owner

Could make my tool be called as ssh and make ssh available as ssh_raw or initial_ssh.

Would be nice if it is a not configured connection, then it works as default ssh and possibly mention such.

Could make my tool be called as `ssh` and make `ssh` available as `ssh_raw` or `initial_ssh`. Would be nice if it is a not configured connection, then it works as default `ssh` and possibly mention such.
Author
Owner
alias fp4sshlocal='ssh -p 8022 _gateway'

is still useful as:

ssh _gateway -p 8022 exit
ignoring bad CNAME "_gateway" for host "_gateway": domain name "_gateway" starts with invalid character
ssh fairphone-4-5g -p 8022
ssh: Could not resolve hostname fairphone-4-5g: Name or service not known

Related to Benjamin-Loison/android/issues/156 and Benjamin_Loison/openssh/issues/16.

```bash alias fp4sshlocal='ssh -p 8022 _gateway' ``` is still useful as: ```bash ssh _gateway -p 8022 exit ``` ``` ignoring bad CNAME "_gateway" for host "_gateway": domain name "_gateway" starts with invalid character ``` ```bash ssh fairphone-4-5g -p 8022 ``` ``` ssh: Could not resolve hostname fairphone-4-5g: Name or service not known ``` Related to [Benjamin-Loison/android/issues/156](https://github.com/Benjamin-Loison/android/issues/156) and [Benjamin_Loison/openssh/issues/16](https://salsa.debian.org/Benjamin_Loison/openssh/-/issues/16).
Author
Owner
Related to [Benjamin_Loison/xclip/issues/1#issuecomment-2578323](https://codeberg.org/Benjamin_Loison/xclip/issues/1#issuecomment-2578323).
Author
Owner
Would help [Benjamin_Loison/Remmina/issues/19](https://gitlab.com/Benjamin_Loison/Remmina/-/issues/19).
Author
Owner
[Benjamin_Loison/openssh/issues/37](https://salsa.debian.org/Benjamin_Loison/openssh/-/issues/37) would help.
Author
Owner
Related to the Tchap message:
-----BEGIN PGP MESSAGE-----

hF4DTQa9Wom5MBgSAQdAycDV10QlwYFArtWO/ke29QUpyvK0fmK1K3R9MMi/nDAw
/bJw+oaDXIAkw48U44lYzMVZLlt/ETtWVLI3pjP2lgWD1Oa2AUZfGqrp/QWkA7hD
0qoBOYl/v3WeMB+o1qHl7c9pRiX+ZvyWzoXKUyPwHEgThfBxJEd0TcQQPE2Jc3n1
LbNyuKthdeRzDV4y/GEtiCqOHe3482IKo+SMtX2PFq5gZYZEElYap/l0Wxd7ZlV1
CvTMjiOpWaJr/BOZmFzeVj6KJqWdRc9Zs7jL3soaAc9jaMaLiOJEgJnBiP3kJNS6
geD/MjsBYT8SyQHfzUO5hyGmDkripIKuKlYp0w==
=6lng
-----END PGP MESSAGE-----
<details> <summary>Related to the Tchap message:</summary> ``` -----BEGIN PGP MESSAGE----- hF4DTQa9Wom5MBgSAQdAycDV10QlwYFArtWO/ke29QUpyvK0fmK1K3R9MMi/nDAw /bJw+oaDXIAkw48U44lYzMVZLlt/ETtWVLI3pjP2lgWD1Oa2AUZfGqrp/QWkA7hD 0qoBOYl/v3WeMB+o1qHl7c9pRiX+ZvyWzoXKUyPwHEgThfBxJEd0TcQQPE2Jc3n1 LbNyuKthdeRzDV4y/GEtiCqOHe3482IKo+SMtX2PFq5gZYZEElYap/l0Wxd7ZlV1 CvTMjiOpWaJr/BOZmFzeVj6KJqWdRc9Zs7jL3soaAc9jaMaLiOJEgJnBiP3kJNS6 geD/MjsBYT8SyQHfzUO5hyGmDkripIKuKlYp0w== =6lng -----END PGP MESSAGE----- ``` </details>
Author
Owner

scp + tab on Termux leads to network devices enumeration, this is to investigate.

`scp ` + <kbd>tab</kbd> on Termux leads to network devices enumeration, this is to investigate.
Author
Owner
ssh_on_same_network_preferably
Output:
Internet proxy
ssh: Could not resolve hostname _other_network: Name or service not known
```bash ssh_on_same_network_preferably ``` <details> <summary>Output:</summary> ``` Internet proxy ssh: Could not resolve hostname _other_network: Name or service not known ``` </details>
Author
Owner
Related to [Benjamin_Loison/seedvault/issues/43#issuecomment-2786526](https://codeberg.org/Benjamin_Loison/seedvault/issues/43#issuecomment-2786526).
Author
Owner
Host oc3k
    Hostname overclock3000

Host oc3k_other_network
    Hostname CENSPORED.lemnoslife.com
ssh_on_same_network_preferably oc3k
Output:
Same network connection
ssh: connect to host overclock3000 port 22: Connection refused
ping -c 1 oc3k
Output:
PING controller.access.network (195.XXX.XXX.XXX) 56(84) bytes of data.
64 bytes from controller (195.XXX.XXX.XXX): icmp_seq=1 ttl=64 time=2.37 ms

--- controller.access.network ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 2.370/2.370/2.370/0.000 ms
ping -c 1 not_existing_9akzbuxw
Output:
PING controller.access.network (195.XXX.XXX.XXX) 56(84) bytes of data.
64 bytes from controller (195.XXX.XXX.XXX): icmp_seq=1 ttl=64 time=2.52 ms

--- controller.access.network ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 2.517/2.517/2.517/0.000 ms
ssh oc3k exit
echo $?
Output:
ssh: connect to host overclock3000 port 22: Connection refused
255
ssh oc3k_other_network exit
echo $?
0
on Debian 12 GNOME laptop on the wifi of the hotel:
-----BEGIN PGP MESSAGE-----

hF4DTQa9Wom5MBgSAQdAIKBKKfSnYNQ+tva7ge3WKYA+UkJUONp4Lcacy4/wl1cw
L9nG52KikuRrKK0MC3ZLIUNJwzCne5BeagLlIUuy6Vle1Xf/w1rvj9IsqwgEP7hw
0k8Bd254DdlcBSrPUpCoRQ4IPw3atnsRN3UQg6jztN+u9/HeWLoQu+wwds+5od8m
4ILbs38uTaUq/+Fn2Tjwblphfx+MGQvZT5NdbPUaboxb
=TXGP
-----END PGP MESSAGE-----
``` Host oc3k Hostname overclock3000 Host oc3k_other_network Hostname CENSPORED.lemnoslife.com ``` ```bash ssh_on_same_network_preferably oc3k ``` <details> <summary>Output:</summary> ``` Same network connection ssh: connect to host overclock3000 port 22: Connection refused ``` </details> ```bash ping -c 1 oc3k ``` <details> <summary>Output:</summary> ``` PING controller.access.network (195.XXX.XXX.XXX) 56(84) bytes of data. 64 bytes from controller (195.XXX.XXX.XXX): icmp_seq=1 ttl=64 time=2.37 ms --- controller.access.network ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 2.370/2.370/2.370/0.000 ms ``` </details> ```bash ping -c 1 not_existing_9akzbuxw ``` <details> <summary>Output:</summary> ``` PING controller.access.network (195.XXX.XXX.XXX) 56(84) bytes of data. 64 bytes from controller (195.XXX.XXX.XXX): icmp_seq=1 ttl=64 time=2.52 ms --- controller.access.network ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 2.517/2.517/2.517/0.000 ms ``` </details> ```bash ssh oc3k exit echo $? ``` <details> <summary>Output:</summary> ``` ssh: connect to host overclock3000 port 22: Connection refused 255 ``` </details> ```bash ssh oc3k_other_network exit echo $? ``` ``` 0 ``` <details> <summary>on Debian 12 GNOME laptop on the wifi of the hotel:</summary> ``` -----BEGIN PGP MESSAGE----- hF4DTQa9Wom5MBgSAQdAIKBKKfSnYNQ+tva7ge3WKYA+UkJUONp4Lcacy4/wl1cw L9nG52KikuRrKK0MC3ZLIUNJwzCne5BeagLlIUuy6Vle1Xf/w1rvj9IsqwgEP7hw 0k8Bd254DdlcBSrPUpCoRQ4IPw3atnsRN3UQg6jztN+u9/HeWLoQu+wwds+5od8m 4ILbs38uTaUq/+Fn2Tjwblphfx+MGQvZT5NdbPUaboxb =TXGP -----END PGP MESSAGE----- ``` </details>
Author
Owner
ssh_on_same_network_preferably -X CENSORED
Output:
Internet proxy
unknown option -- _
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
           [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
           [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
           [-i identity_file] [-J [user@]host[:port]] [-L address]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-Q query_option] [-R address] [-S ctl_path] [-W host:port]
           [-w local_tun[:remote_tun]] destination [command [argument ...]]

An alternative is to use ssh -X CENSORED_other_network or maybe modify ~/.ssh/config.

```bash ssh_on_same_network_preferably -X CENSORED ``` <details> <summary>Output:</summary> ``` Internet proxy unknown option -- _ usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface] [-b bind_address] [-c cipher_spec] [-D [bind_address:]port] [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11] [-i identity_file] [-J [user@]host[:port]] [-L address] [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] [-Q query_option] [-R address] [-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]] destination [command [argument ...]] ``` </details> An alternative is to use `ssh -X CENSORED_other_network` or maybe modify `~/.ssh/config`.
Author
Owner
ssh_on_same_network_preferably CENSORED
Output:
Internet proxy
ssh: Could not resolve hostname CENSORED.ddns.net: No address associated with hostname
kex_exchange_identification: Connection closed by remote host
Connection closed by UNKNOWN port 65535

If CENSORED does not match the hostname of the server, then it always use Internet proxy I guess, like currently as the proxy domain name is offline.

```bash ssh_on_same_network_preferably CENSORED ``` <details> <summary>Output:</summary> ``` Internet proxy ssh: Could not resolve hostname CENSORED.ddns.net: No address associated with hostname kex_exchange_identification: Connection closed by remote host Connection closed by UNKNOWN port 65535 ``` </details> If `CENSORED` does not match the hostname of the server, then it always use *Internet proxy* I guess, like currently as the proxy domain name is offline.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Benjamin_Loison/linux#32
No description provided.