Showing posts with label remote. Show all posts
Showing posts with label remote. Show all posts

Monday, August 13, 2007

Network: a problem about 'Connection reset by peer'

When I log in a remote computer by ssh from my home and if I keep it inactive for a while (for example, 10 mins), I often was kicked out with the message, for example:
=====================

Read from remote host jasper-clued0.fnal.gov: Connection reset by peer
====================

This happened probably because a firewall or other packet filtering device (such as your router) drops idle connections after a certain period of time.

------------------------------------------
A solution based on the ssh server side
can be found here (Dugan provided me with this solution):

http://www.brandonhutchinson.com/OpenSSH_ClientAliveInterval.html

Simply speaking, the solution is add a line

ClientAliveInterval 300

in the file:

/etc/ssh/sshd_config

and reload the sshd server configuration with

/sbin/service sshd reload

--------------------------------------
Another solution based on client side provided by my colleage Horst at Fermilab is:
to add

echo 300 > /proc/sys/net/ipv4/tcp_keepalive_time

into the file /etc/rc.local

Monday, May 7, 2007

Linux:ssh: how to use ssh command remotely

Usually, when you want to run a command on a remote computer, you have to log in first. If you have ssh, you can use remote-command way:

ssh your.remote.computer.com yourCommandHere

For example,
ssh smart.phys.sfu.ca date

Wednesday, March 21, 2007

ROOT: how to use Scan

In ROOT (http:root.cern.ch), if you wanna to open remote root file and browse its structure or data, it is very slow if using tree->Draw() method. So, you could use tree->Scan() to browse data:

 For example:
tree->Scan("a:b:c","","colsize=30 precision=3 col=::20.10:#x:5ld");
Will print 3 columns, the first 2 columns will be 30 characters long,
the third columns will be 20 characters long. The printing format used
for the columns (assuming they are numbers) will be respectively:
%30.3g %30.3g %20.10g %#x %5ld

Locations of visitors to this page