Help – My Machine is Locked Down and I Can’t Install the IBM Cloud CLI Tool!

When it comes to development on the IBM Cloud, the ‘ibmcloud’ CLI tool is really useful. For those that are not familiar with the tool, it’s a package which you can install on your local machine, that gives you the ability to interact with the IBM Cloud from your local command line, without the need to log into the full console.

As mentioned, to use the CLI tool, you need to install it onto your local machine. However, a number of clients have been telling me that their local machines are locked down by Enterprise-wide settings, which means that they are unable to install the tool and use it. This isn’t unusual in organizations where users are provided machines with standard builds, which the IT Department supports. In such cases, there’s usually a process to go through to have new software approved, which may include a level of testing against a build and other approvals. This can take time!

I’ve been thinking about ways to help those users stuck without the CLI.

What I have done is create a very basic virtual machine in my IBM Cloud account and install the CLI tools onto that. This works well and assuming that the developer has ssh access from their local machine, this is a great solution.

So, how to do this? Well, to make it really easy, I created a Public Image Template which can be used by anyone to create a new Virtual Server Instance, with everything they need to get going with the CLI installed.

To use the Public Image Template, follow these steps:

  1. Log into your IBM Cloud account
  2. In the top left corner, click the ‘hamburger’ icon and select ‘Infrastructure’ from the drop-down menu (you can shortcut this step by just hitting control.bluemix.net)
  3. Click Devices -> Manage -> Images from the left-hand menu
  4. This will show your Image Templates. Where it says ‘Private Images’, select ‘Public Images’ from the drop-down
  5. Look for a template called Simple Ubuntu VM with IBM Cloud CLI. Note, this page does not have a simple ‘search’ function, so it may be easier to order the templates by ‘Create Date’ (click on the heading) – the template was created on ‘2018-10-10’.
  6. Click on ‘Actions’ and select one of the ‘Order’ options. This will open an order form.
  7. Select the data centre where you would like the VM to reside. Normally, this would be the one closest to your physical location, or perhaps closest to your IBM Cloud deployment if they are different.
  8. Then pick a Flavour option. Since this is going to be a pretty lightweight machine, I would choose the top option (C1) from the Compute flavours, as this tends to be the cheapest.
  9. Scroll to the bottom and click ‘Add to Order’
  10. This takes you to the ‘Check Out’ screen. Under the Advanced System Configuration settings, provide a hostname for your virtual server and a domain.
  11. Click the two check boxes to acknowledge T&Cs and License terms, then click Submit Order. At this point, your machine will start provisioning.
  12. Go back to your list of devices (click Devices -> Device List from the left-hand menu). You will see your machine is provisioning (denoted by a ‘clock face’ icon beside it.
  13. When the machine is provisioned, you will see a Public IP address (as well as a Private one) beside its name. Click on the name of the server.
  14. Open a terminal on your local machine and use ssh to connect to the server, as follows (substituting the ‘xxx’ with your server’s Public IP address:
ssh cliuser@xxx.xxx.xxx.xxx
  1. Provide the password for the user – the default is cliUSERPASSWORD! (case sensitive)

NOTE It is strongly recommended that you change the cliuser password on your image, particularly if it persists for some time, since EVERY server created using this template will have this password as a default. To do this for cliuser, type:

 

            passwd
  1. You are now good to go and can use the IBM Cloud CLI (just type ‘ibmcloudcli help’ to see a list of commands)

What does the image include?

The image has the IBM Cloud CLI installed, including the dev, container-service and container-registry plugins. It also has Docker installed. These may need updating from time to time but the CLI will prompt as they are used.

Other Considerations

  1. Think about how long your Virtual Machine might be needed for. Could you save money by provisioning a new machine each time you need it (note it can take up to 20 minutes) or by using Transient Virtual Servers?
  2. If you need to lock down access to the VM, consider using Security Groups and restricting access to a set IP address range, for example.

More help

You can find a full list of IBM Cloud CLI commands here

Want a Windows desktop with a richer set of tools installed? Check out this post!

Cheers,

James

 

Advertisements

One thought on “Help – My Machine is Locked Down and I Can’t Install the IBM Cloud CLI Tool!

  1. Pingback: Help – My Machine is Locked Down and I Can’t Install the IBM Cloud CLI Tool (Part2)! | The IBM Cloud Digest

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.