Mar 032013
 

Many NAT firewalls or VPN server time out idle sessions after a certain period of time to keep their trunks clean. Sometimes the interval between session drops is 24 hours, but on many commodity firewalls, connections are killed after as little as 300 seconds, and this can be a problem if you are working on a remote machine and suddenly you find yourself logged out with a message “Connection reset by peer”.

In a former article I’ve presented autossh, a solution that comes to your help when you want to be sure that a SSH connection stay always on between 2 machines. Autossh is a simple program that allows you to run an instance of ssh, keep it under control, and restart the same instance once that the connection is dropped up to a maximum number of times controlled by an environment variable.

This is useful if you need to have a “permanent” connection between 2 machines, but perhaps you just need to have a connection between your personal computer and different servers, and in these cases autossh is less useful, so let’s see how to use some openssh options to keep our connection open.
Continue reading »

flattr this!

Dec 122012
 

Only recently I’ve started to work with Git, don’t blame me I’m mainly a system administrator not a developer, and one of the things I’ve been asked to setup is a way to have a cloned Git project shared over SSH to a particular group of person that share the same linux group.

The issue is this setting are the permissions that must be properly set so you and the others don’t end up stomping on each other when pushing changes, so let’s see how to achieve this goal quickly.

Continue reading »

flattr this!

Jul 222012
 

Sometimes you have some firewall that don’t allows you to accept connection other than some specific ports let’s say that you can connect on your VPS or remote server only on the ports 80 (http) and 443 (https), but you need a port also for ssh to manage your vps/server but the port 443 is used by your Web server with its https protocol, so what can you do ?

This is where sslh comes in. It’s a really simple tool that wraps incoming connections to a port and then depending on protocol redirects it onto sshd back on port 22, or to your web server on localhost:443.
Continue reading »

flattr this!

2 practical examples of Expect on the Linux CLI

In my work I’ve not used “Expect” many times, but to do some jobs I’ve learnt how to use it, and I must say that to complete some tasks this program can help a lot and be a valid alternative to more complex solutions, like a complete program in python, php or your favorite scripting [...]

PAC Manager: All your Connection are belong to us

If you manage remote machines you have for sure some way to connect to them, to connect to Unix machines I’m used to open a terminal with my favorite terminal emulator (Terminator in these days), and from there ssh to other servers, for Windows RDP protocol as client i use Remmina (perhaps i’ll talk of [...]