Tag Archives: SSH

Type Less With SSH Aliases


first this is to make sure you have installed SSH by using this command

sudo apt-get install openssh-server

then you will edit SSH config file with this command

sudo nano /etc/ssh/ssh_config

and add this on the end of the file

# Alias
Host (hostname)
HostName (hostname ip address)
User (username you want to use eg is root)
Port (port #)

save and restart

sudo /etc/init.d/ssh restart

Keeping SSH Sessions Alive

I noticed recently that ssh connections from my Dedicated Centos Server to my Fedora server would time out and disconnect if I left the connection idle for a long period of time. This really annoyed me, as you have to login again specially if you have some edited files open and forgot to save the changes you made

I added the following line to /etc/ssh/ssh_config :

ServerAliveInterval 5

That seems to have fixed the problem, and my centos server can now remain connected, though idle, to my server.

What this does, essentially is every 5 seconds, the client sends a small keep-alive packet to the server to make it look like the ssh connection is being actively used.

PuTTY SSH Client for Nokia N95

i have been thinking about this app PuTTY for Symbian OS, an SSH client for my new Nokia N95. After figuring out the correct version to download, there are several versions available for the different editions of Symbian, the installation was super easy and simply consisted of clicking a few confirmation buttons. By the way, the correct version for the Nokia N95 is the S60 third edition.

Regarding usage, I found using PuTTY useful for work ; I connected to one of my Fedora systems at home, and my boss servers, impressive stuff, even if I do say so myself! For me, the ability to run an SSH client gives a whole new meaning to the term “smartphone“. Is there anything this phone can’t do?

Guide on changing SSH port and opening new port

1.) Check the port to be used if its already in use or not: netstat -nap | grep port#
2.) Open the port to be used:
– if using CSF, add the port on “Firewall Configuration”, put it on TCP_IN and TCP_OUT, restart CSF.
– you may use iptables manually: iptables -A INPUT -p tcp –dport port# -j ACCEPT
3.) Save changes by issuing: “service iptables save”, don’t flush iptables this may bring the serve down, it happened to me :):)
4.) Edit SSH config (/etc/ssh/sshd_config), and comment our the “#Port 22” and change that to the new port. Please comment out “#Protocol 2,1” and use “Protocol 2” for security.
5.) Reload SSH config, “service sshd reload”, and restart SSH, “service sshd restart”.
Note: when restarting SSH for applying the new port please open another Putty window. Just in case you experience problem you still have an open SSH window. Don’t restart via WHM, this will close all open SSH window (putty), and this will present you a message that SSH didn’t started ok, but its running. Just try to login on the new SSH port.