ssh connection “client_loop: send disconnect: Broken pipe” or “Connection reset by port 22”

I have been using ssh to access remote servers for many months, but recently I haven’t been able to establish a reliable connection. Sometimes I cannot login and get the message “Connection reset by port 22”, when I can login I get the error message “client_loop: send disconnect: Broken pipe” in a few minutes (even if the terminal is not idle).

My ~/.ssh/config file has:

Host *  

     ServerAliveInterval 300
     ServerAliveCountMax 2
     TCPKeepAlive yes

My /etc/ssh/sshd_config file has:

#ClientAliveInterval 300
#ClientAliveCountMax 3

I recently upgraded by xfinity plan to a faster speed and the problem started happening then. But xfinity insists the issue is on my end. Note that my roommate also has the same issue with ssh…

Is there something that I’m missing on my end? Any help would be greatly appreciated!
(I’m running on a Mac)

Go to Source
Author: Ashka Shah

How to obtain the path of a Bash script, when it’s executed through a symlink?

I want to obtain the path of a Bash script, is when it’s executed through a symlink.

In this case, $0 is -bash, while BASH_SOURCE is the symlink’s path.

Can I obtain the script’s path through some shell variable, built-in shell command, or external command?

Will BASH_SOURCE always holds the initial symlink’s path, even if the script is executed through several levels of indirection (multiple symlinks)?

Could I use ls with BASH_SOURCE to always retrieve the script’s path?

Go to Source
Author: Shuzheng

ls -h command in mac osx Catalina 10.15.2 not working

I’m a newbie and this is probably a very newbie question be forewarned. When using terminal in zsh mode, entering ls -h does not output the expected result. Instead I receive an output as if I just entered ls without the -h. What could be the cause of this? Does ls -h not function the same in zsh mode?

Go to Source
Author: zaddy

If I am trying to clean install a MacOS with internet recovery, is it safer to use mobile network than WIFI network?

I just clean installed my MacOS Catalina on my MacBook due to virus on my PC that I worried got on my MacBook via usb file transfer.

I did an internet recovery to reinstall MacOS Catalina with my home WiFi network, with password protected. However, since my Pc was had a virus, I was worried that my IP addresss and home WiFi network has been compromised, can I still trust that the installation was not tempered with? Or should I perhaps reinstall it again using mobile network? Since I have heard that mobile data are much more secure than WiFi network.

Go to Source
Author: Ecotistician