After two posts we’ve decided to change the naming scheme a bit. Having a somewhat day for day summary seemed cool at first, but is a bit restricting so now we’ve changed it to an endless «Part X» naming convention. This will allow us to rapidly post new stuff if there is something worth posting. Cool? Yes. Very.
Being a developer that dabbles in both the front-end side of things as well as the back-end side of things I often find myself on the server-side scavenging the logs of failed HTTP requests and what not. This is often Linux servers running somewhere in the globe and the preferred way of remoting in is using SSH.
Equipped with just my phone and the Display Dock how can I enter the role of a sysadmin/devops from anywhere?
- Provision a new server
- Connect to the server using SSH
- Install some server software
I’m not going all out on the «provisioning» part. Let’s keep it simple yet cool.
Provisioning a new server
There are many options out there for creating new server instances. If you’re already a part of larger team you probably have procedures/scripts/Chef/Puppet/insert-another-name-here for provisioning new server instances on premises or in the cloud.
Being the Microsoft Hipster that I sometimes portray; the natural choice falls on using Azure for all my server and cloud needs. If you want to use Amazon, Google, Heroku or any other provider then that’s OK.
Since we a browser we can pretty much do all Azure related tasks. Creating a new server from the Azure Portal is easy as you can see in the next couple of screenshots. I create some Ubuntu Virtual Machines to simulate having a staging and production environment.
The only issue here and I’m sorry for having to repeat myself: the Edge browser on Windows 10 Mobile. It is slow and does not handle these heavy sites like Azure Portal, Facebook and so forth.
Connect to the servers using SSH
On Windows 10 Mobile we do not have access to tools like PowerShell or PuTTY, but one great tool that is highly customizable and seems to support windowed mode is Token2Shell/MD (https://www.microsoft.com/store/apps/9nblggh2ncx9).
You can try it for free or buy it at a highly discounted price for the next 12 days or so (which I did).
The app allows for quickly connecting to different hosts and can handle private keys, has got an address book for storing your server information and can be quite customized down to what terminal emulator you want to use.
Using the hostname, username and password that I got from Azure I can quickly connect to my newly created servers. There seems to be no problem with the shell output or input as of yet. Then again, I haven’t tested anything complex yet.
Installing some server software
The easiest way to get up and running with a server is installing a well known HTTP server: Apache. With Ubuntu this can be achieved using apt-get install apache2.
The install process will take care of dependencies and will attempt to start the server with the default options. For this purpose that will be just fine.
If you try to navigate to the server using your browser you will probably not get any response. The apache server is indeed running, but Azure does not allow any connections other than SSH, so we will have to add a new endpoint in the Azure Portal. Under Settings for the VM and then Endpoints you should be able to add a new endpoint.
When the endpoint is created and the changes flow through all the systems you will be able to connect to the server.
This is all pretty easy stuff, but the option of having a SSH client that supports multiple sessions in windowed mode is just powerful stuff. From here on out you could provision your own Ubuntu virtual machine that you can use for development and further Azure command line stuff if you don’t like to use the Portal.
With a full-fledged albeit buggy browser like Edge and an awesome app like Token2Shell/MD (could have gone for a bit sexier name) doing server administration or cloud management can easily be done using only your phone and done well.