Creating a Launcher to Connect to Remote Screen+Irssi Session
We all love SSH+Screen+Irssi for our IRC’ing setup, but, it gets annoying having to open up a Terminal window, manually type in the ssh command to connect to the remove server, logging in with our username and password, and re-launching the screen session all the time. So, I came up with a more automated way of doing this so I can just click on an icon, and bang-o, i’m in.
With this method we will use password-less login using ssh private-key authentication. We will be storing the private key without a passphrase to make the process more streamlined. Doing it this way does open up some security concerns, so you have to be more mindful of your SSH keys and who has access to it.
So, first off, on the client computer (the one we will be using to connect to the SSH server), we need to generate our SSH keys:
user:~$ ssh-keygen -t dsa Enter file in which to save the key (/home/user/.ssh/id_rsa):
Take the default location for where to save the key by pressing Enter
Enter passphrase (empty for no passphrase):
As stated earlier, we want to keep this blank to streamline the process. If you aren’t comfortable with leaving it password-less, then you can enter a passphrase here, but you will be prompted for it every time you go to connect, defeating the purpose of all of this essentially. When you decide what you’re going to do, press Enter. The program will now generate your public and private key-pairing in the location above.
By default, your private encryption key (id_dsa) is set to permissions 600, which means you have read/write access to it, while nobody else has any access to it. Your public key file (id_dsa.pub) will have permissions of 644, which means you have read/write while everyone else has read-only. This is normal, and fine.
Next step is, we have to add our new public key to the authorized keys list on the server, so that the next time we log in, the server will see that we are already authorized and let us in without any questions. First, we will upload our new public key to the server:
user:~$ scp ~/.ssh/id_dsa.pub myuser@remoteserver:~
Next we need to login to the server and add the key to the right place. Please note, you will be asked for a username and password this time, but after this it will no longer be needed:
user:~$ ssh -l myuser remoteserver user@remoteserver:~$ cat id_dsa.pub >> ~/.ssh/authorized_keys2 user@remoteserver:~$ rm id_dsa.pub user@remoteserver:~$ exit
Now, once you’re back on your local computer, try to re-login to the server, it should now take you right in, no questions asked.
This time, while in, we can start up our screen and irssi session. What we will do, for simplicity, is name our screen session to make reconnecting easier in the future.
user@remoteserver:~$ screen -S irssi user@remoteserver:~$ irssi
From here, you can connect to your IRC server and channel, then when you’re ready, detach your screen session, disconnect from the server, but leave your Terminal screen open
irssi screen: Ctrl+A D
user@remoteserver:~$ Ctrl+D
user:~$
This next step is optional, but, I found it useful. Inside the Terminal program, go to Edit->Profiles and then click New and name it irssi. Go through the settings and make sure everything is how you like it for IRCing, for example, I prefer to have the background black with foreground white for IRC. Also, make sure that on the Title and Command that “When command exists: and the bottom is set to Exit the Terminal.
Once that is all saved, close off the window and close down Terminal. Next step, we will create the Launcher icon in Gnome. So, right-click on the Panel up top, and click Add to Panel then select Custom Application Launcher from the list. Fill out the dialog boxes with the appropriate information:
Name: Irssi Command: gnome-terminal -e "ssh -t -l user ipaddress screen -x irssi" Comment: whatever you want here
Hit OK, and test it out. It should pop up a Terminal screen, automatically connect and restore your screen session.
Comments are closed.


