Handy apps – Windows terminal and Bash for windows
Working in a mixed server environment means that I need to be able to manage and access both windows and linux, on the windows side I have the Windows Admin Centre (formally project Honolulu), RSAT and RDP.
On the linux side, normally I would install Putty and use that, however, Microsoft have released both ssh for windows and the windows terminal. Both make for a very handy app combination.
Windows terminal is an open source project and, as such, is downloadable from git https://github.com/microsoft/terminal
If you’d prefer to just automate the install then there is also a chocolately repo for it:
While not official, it is fantastic to see Microsoft at least referencing it in their official documentation, note that you will need to be on Windows version 1809 (build 17763, aka the October 2018 update).
Once terminal is installed, it can be launched by typing “Windows terminal” at the start menu:
The windows terminal app is a tabbed application so it is possible to have multiple tabs for cmd or you can launch powershell, powershell core, etc. Adding tabs is relatively easy as it is just a matter of getting the JSON file and adding in a new section.
There are a couple of oddities that I have come across with Windows Terminal.
One is that changing the font colour is done via scheme system which can be a little fiddly to master and the other thing that really tripped me up is copying information out of the terminal screen.
I found that it was not enough to highlight the result and hit enter, I had to right click on the highlighted section before the data was copied to the clipboard.
Now that terminal is installed, the next thing I want to look at is the OpenSSH client.
The install is found under all settings -> Apps and features -> optional features -> add a feature and search for OpenSSH:
Now that you have SSH for windows installed what does it offer?
Logon to a Linux server
The main usage for the OpenSSH client is going to be to log on to a server and this is easy enough to do with the command ssh [user]@[server] and enter
Logon to a Linux server using SSH keys
As environments get more secure, most servers no longer allow password access over SSH, preferring instead to use SSH keys. OpenSSH on windows can handle that as well. Note that if you are used to doing key based auth with putty, you will need to convert the PPK file to a text based file. You can do this using puttygen and export an openSSH key.
ssh –i [identity file] [servername]
Copy a file
Open SSH on windows makes it very easy to copy files to and from a linux server, if there is a log file I want to review, I can ssh it down with the command:
scp [user]@[host][remote path] [local [path]
I hope that this blog has shown some of the value in both the windows terminal app and the open ssh client, I like both of them although I do trip over the copy and paste behaviour in Windows terminal from time to time.
If there is anything you would particularly like me to cover in a future blog, please do feel free to drop me a line, you can see my contact details here.
Subscribe to Ramblings of a Sysadmin
Get the latest posts delivered right to your inbox