Wednesday, May 3, 2017

Create and configure a Nano Server

The Nano Server is the new darling of Microsoft. Nano Server has a little footprint, it's light, fast and have reduced surface for eventual hacker attack. Is a minimal service system. Well let's install them to make some tests.

First you need a media of Windows Server 2016, an evaluated version can be downloaded from Microsoft web site (here). Make a base install of Windows Server 2016 on your prefered virtualization software (Hyper-V, VMware, VirtualBox, etc) after that, insert your media and let's begin. 

You must copy a directory from media inside your hard drive to have some standard scripts. So assumig that your hard drive is C: and media drive is D: 

Start a PowerShell as Administrator and create a folder on C:

mkdir C:\NanoBase 

Then let's copy the scripts and modules that will be imported later.


copy D:\NanoServer\NanoServerImageGenerator\*.* C:\NanoBase

Now we must import modules in Powershell, just run:


import-module C:\NanoBase\NanoServerImageGenerator.psm1

Let's create a virtual disk that will run Nano Server with Microsoft Web Server (IIS). But some parenthesis here, if you use other virtualization software than Microsoft Hyper-V, you must convert the vhdx disk file to appropriated format that your virtualization software could recognize as a virtual machine. That's for another post!

To create a virtual disk you just run a Powershell cmdLet:


new-NanoServerImage -Edition Standard -mediapath D:\ -Basepath C:\NanoBase -targetpath
C:\NanoBase\nano-test.vhdx -DeploymentType Guest -computername NANO-TEST -storage
-package Microsoft-NanoServer-IIS-Package

Then the command will ask you a password credentials for Administrator that will be used in Nano-TEST machine. Choose one that you wish. Thus, the process of creation will continue, and in the end you will have a virtual disk named: nano-test.vhdx  inside C:\NanoBase

That nano-test.vhdx must be imported for your virtualization software, then run it. When it is started, you will face the Nano Server simple screen, you can make a login and configure few things like rules and address, but remember that Nano Server don't have an elaborated interface, just a simple console. For more configurations you must use other tools like PowerShell remote session (Enter-PSSession), then use the full power of cmdLets. That's for future post.

Enjoy!




Monday, May 1, 2017

Using Ubuntu behind proxy server!

Normally the enterprise environment have a proxy server for security and log reasons. How we can use Ubuntu to navigate and install packages behind that proxy? It's easy, only few lines need a little change.

First you need add the proxy settings on System Settings | All settings | Network | Network Proxy just like below, click on Apply System wide and close.



Then to use the apt package manager you need the proxy environment set and /etc/apt/apt.conf configured. So let's see this files.

/etc/apt/apt.conf

Acquire::http::proxy "http://user:password@172.16.100.100:8088/";
Acquire::https::proxy "https://user:password@172.16.100.100:8088/";
Acquire::ftp::proxy "ftp://user:password@172.16.100.100:8088/";


You need change the apt.conf file to add user, password, IP address and port of your Proxy server, like file showed before.

To set environment variables to use proxy you can use your /home/user/.profile to make permanent changes or use a terminal to configure for the current session.

On terminal type:

~$ export http_proxy=http://user:password@172.16.100.100:8088
~$ export https_proxy=https://user:password@172.16.100.100:8088
~$ export ftp_proxy=ftp://user:password@172.16.100.100:8088

To verify type on term:

env | grep oxy

This will find for any match for pattern "oxy"  like "proxy" in environment variables.

Well be happy and use your linux in all places.
;ยบ)