how can i fix ssh timeout? - cluster-computing

all
The cluster system is constructed using the Perceus program. (scientific linuxs 6.9)
I installed condor in the vnfs file.
After this, when I make an ssh connection, I get a problem that ssh connection is disconnected after 10 minutes. The command is not recognized as shown below.
ssh was not disconnected before installing condor. However, we confirmed that pinging is done without loss.
how could fix this problem? Please suggest a solution
enter image description here

Can you go to this directory to edit ssh file
cd /etc/ssh/sshd_config
change
ClientAliveInterval 120
ClientAliveCountMax 720
This will make the server send the clients a “null packet” every 120 seconds and not disconnect them until the client have been inactive for 720 intervals (120 seconds * 720 = 86400 seconds = 24 hours).

Related

Setting TCP KeepAlive timeout in windows 10

is there any way to set the system TCP KeepAliveTimeout in Windows 10?
In linux it is possible to do this thing by the following command:
echo 60 > /proc/sys/net/ipv4/tcp_keepalive_time
This command establishes a 60 second timeout for all connections.
I will appreciate any help
I tried creating the variable 'KeepAliveTime' in:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters
But it doesn't work.

Ping google.com to see if vpn-server is up, if down, reconnect to another one

I am using a VPN server on a vps. The VPN service I use can of course go down for a few minutes or maybe even hours by accident or whatever. If it happens, I would like to quickly reconnect to another vpn-server with the command "vpnapp reconnect".
Does anyone know how to do a bash script I will run every minute via cronjob that:
Pings google.com
2A) If it can be reached, do nothing
2B) If it cannot be reached - which would mean the vpn server is down/not working - enter terminal command "vpnapp reconnect" which will make the vpn application reconnect to next available server they offer.
Would be so thankful if anyone could help me. I have ZERO programming knowledge. To me this is pure science.
Thanks in advance.
Oski
Can it be this simple?
if ping -c 4 google.com ; then exit ; else vpnapp reconnect ; fi
So if 4 packages are received, meaning google.com can be reached it will just exit the bash script.
if not, then it will just enter
vpnapp reconnect
as a command in the terminal... reconnecting the vpn.
or does it need to be "vpnapp reconnect" embedded in "?
Lol i am so weak at this. I really dont trust my own suggestion anyway so would love to hear a real programmer speak. Thanks!!
You don't need a bash script, you can just add this cron job (with crontab -e):
* * * * * ping -c2 google.com || vpnapp reconnect
* * * * * Run the command every minute.
ping -c2 google.com Send 2 pings to google.com.
|| vpnapp reconnect mean that if ping failled it will run vpnapp reconnect

How to ping with duration 60 seconds in CMD Windows 10

How do I ping for 60 seconds in CMD?
ping www.google.com -t60
Doesn't works.
The command is working but not as you wanted since -t flag is for continuous ping unless stopped.
I think this ping feature you are looking for is available in Linux
It uses -i flag for interval from what I recall.

tcpprobe does't exist in /proc/net/ when I used SSH

I am new in world of network. I made a simple SDN that contains 3 hosts, one switch and a controller. I would like to monitor the traffic using tcpprobe. I opened a terminal using xterm h1 and ran the shell there. I also made iperf server in h2. But the tcpprobe was not existed in /proc/net/ directory when I use a SSH terminal!
enter image description here
However I installed it on my VM and it is exist in /proc/net/ of my VM.
enter image description here
sudo apt-get install transcode
Here is my shell code:
#!/bin/bash
#used variables
eth=h1-eth0
port_to_probe=5001
#we will probe the iperf port
server_addr=10.0.0.2
#LOAD TCP CONGESTION CONTROL MODULES
modprobe tcp_probe port=$port_to_probe full=1 bufsize=50
for time_test in 10 20 30 60 10 20
do
echo "Traffic transmission time set to " $time_test "s randomly.\n"
#start logging data
sudo cat /proc/net/tcpprobe > tcprobe.dat &
#get the cat process ID to later kill it
pid=$!
#kill the logger
kill $pid
done
Can anybody help me?
The problem was that, each SSH use a port to connect to VM and this cause a change on the address of /proc/net/. To solve this problem it is enough to change the mentioned address to /proc/6337/net/. By reading this address in fact you read the real VM directory. So the final code will change to:
cat /proc/6337/net/tcpprobe

How to run bash code inside netcat connection

So i have a problem : i want to run bash commands when i connect to a server. I have to capture the flag when i connect to a server X via port Y, it stays open only 5-10 sec then closes and you need to guess the random number from 1 to 1000. The for is not the problem (for i in {1..1000} echo $i), the problem is how i make the netcat wait until the connection is done and then run a command. I searched on stackoverflow and a lot of websites and it is not what i need.
while ! nc server port; do
sleep 0.1
done
and somwhere here run the command but if you run it over the while, it will run when the netcat is closed

Resources