Do you need to run a command on SSH login? There are a lot of solutions on the web for this, but most of them are very complex. I stumbled across this easy method of using the authorized_keys file, simply add command="ls -l" (replacing ls -l with something a bit more useful like tmux or screen) in front of the key fingerprint. This also means you can have different commands for different keys if you choose.
I’m a big fan of the shell and the productivity it brings, you can have a text editor, command to run a server and more within easy reach. I use a shell at work, at home and on the go. On the go could be using my iPad or iPhone. One of the first SSH clients on iOS was iSSH, which I used many years ago. After this, Panic released a professional class application called Prompt.
If your like me and you deal with a lot of servers for development or test and do it from a Unix machine, I’ve got a really handy tip: SSH hostname pattern matching. Say I’ve got a SSH config file like this (at ~/.ssh/config ): host s* HostName atrcu%h.example.com User example1 Port 22 host b* HostName atrcx%h.example.com User example2 Port 22 host ??* HostName atvts%h.example.com User example5 Port 2205 The ssh man page explains this really well:
**Note: This Guide was written for use by my Computer Science class on Linux (and Mac OS X where noted). I haven’t used SSH on Windows; but hopefully someone can make sure this guide works also on Windows by noting differences). SSH comes with nearly all Linux distros and all Mac OS X releases. ** OS Specific Colours: Linux - Mac OS X - Windows ** ** **Download SSH For Windows