Monday, October 29, 2012

Throwback Skills - Enable SSH on VMware ESX3.5

 
 
So... I found myself the other day needing to SSH into a VMware 3.5 host and was reminded of how spoiled us VMware dudes are these days to be able to enable SSH in the GUI/vCenter etc. as we are in current vSphere versions (4, 4.1, 5. 5.1)
ESXi 3.5 does have the ability to run SSH, but it is disabled.

***Additionally it is not supported by VMware.
So here's the scoop on what you need to do in order to set it up:
Log into the console of the ESXi host and press ALT-F1. This will open the console window.
Once you are in the console window, enter the word "unsupported" and press Enter (Note - You will not see the text your typing)

Following this you will see the a "Tech Support Mode" warning and a prompt for a password. This will be the password for the Root login of the host.
You will be brought to the prompt of ~ #.
 
Now you will need to edit the file named inetd.conf:  To do this enter the command "vi /etc/inetd.conf" (No quotes)
 
Perform the following steps:

Find the line that begins with #ssh and remove the #. then save the file by moving the cursor down to #ssh line and then press the Insert key.
 
Move the cursor over one space and then hit backspace to delete the #.
 
Then press ESC and type in :wq to save the file and exit vi.
 
If you make an error in typing, press the ESC key and then type it :q! to quit vi without saving the file.

The vi editor should be closed now.

Now you just need to restart the management services on the host. Back at the command prompt, run the command /sbin/services.sh restart.

You'll now be able to connect to the ESXi host with a SSH client.
***Of course if all you need to do is perform some command line stuff at the physical console of the ESXi host you can just go the ALT-F1 > Unsupported route and fire away!

Enjoy!

Tuesday, October 23, 2012

Configuring Network Settings From The Command Line Using NETSH


 
 
 
So recently we were tasked with performing a network configuration change for a customer that had the need to add multiple IP addresses to their network card on server all in remote sites. Logging into each one of these machines via RDP (Windows servers) in this scenario would have been tedious..
 
Do you have the need to locally or remotely, display or modify the network configuration of a computer/server? do you prefer the streamline of the command-line? 
 
If so then the NETSH command can prove useful for you.
 
 NETSH also provides a scripting feature that allows you to run in batch mode.
 
If you are looking to script against a multiple numbers of machines then NETSH additionally can save a configuration script in a text file to replicate outputs/setting changes to other servers.
 
There are many commands and switches contained within the NETSH command. 
 
By typing the "/?" switch for NETSH, the help menu which is actually quite helpful can be accessed..
 
 
 
Enjoy!

Thursday, September 8, 2011

How to find out the last boot up time of your server:

Often as a Systems Engineer/Administrator we need to know the last date/time a server rebooted.
When working with Windows Server 2003 or Windows Server 2008, this information can easily be provided via the command prompt.

You can navigate to the command line by clicking on Start -> Run.

Once you are in the Run prompt, type ‘CMD’, and click OK. This will open a command prompt window.

Once the command line window is open you will be presented with a DOS prompt.

At the DOS prompt Type in, ‘net statistics server’, and press enter.






The next screen will display various statistics for your server, the first one will be the date and time the server last booted.




Sometime tracking down why a server rebooted (on its own) can be a challenge.

At least with this method, finding out when it happened will not be…. :)

Hope this helps!

Enjoy!


Monday, August 22, 2011

FYI: Microsoft Exchange ActiveSync, IMAP or POP will not work with Android version 2.3.4 with self-signed SSL certificate.


If you are like me and purchased a new Droid3 by Motorola (Which I love by the way), or another Android OS based device that has version 2.3.4 installed, you might notice that some of your Corporate email (Microsoft ActiveSync), IMAP or POP connections are no longer working.


This is because the email client installed with version 2.3.4 does not accept SSL connections from Microsoft Exchange servers or any other Mail server with self-signed certificates.


This is especially a big deal if your mail server in question is Microsoft Exchange 2010.

So to fix this is simple:

Acquire a SSL certificate from a 3rd party source (Go Daddy, Network Solutions, DYNDNS, etc.) and install it on your Exchange server and your connection problems with your mobile clients should go away.

When purchasing your certificate there will be various decisions to make in regards to the certificate depending on your Exchange environment (i.e. Multiple domains, Unified Messaging, Auto Discovery, Outlook Anywhere, etc.)

Hopes this helps someone out there!

Enjoy!

Thursday, August 18, 2011

Manage open files and shares in Windows Server 2008



Under the “Administrative Tools” menu in Windows Server 2008 is a utility called Share and Storage Management.(SSM)

SSM was originally brought out in Windows Server 2003 R2.

SSM is a collaboration of previously separate tools like Disk Management, Defragmenter, Resource Manager and SAN Storage Manager.



To start the utility, choose Start>Administrative Tools>Share and Storage Management:





From the Action pane on the right hand side of the tool, you have various options to choose, like "Manage Open Files".

For instance, to see what files are open on your system, you would click “Manage Open Files” and a screen will open up that shows you a list of the files and folders that are open on your server.


The list tells you which user that has the file open and the file’s location.




From here you have the option to close an open file by either choosing the file or clicking the Close Selected button.

Alternatively, if you are looking to bump everyone out of a server or share, you can do this by clicking “Close All”.


Keep in mind that you will soon have a long line of angry users at your desk or blowing up your phone as users will lose any unsaved work once you “pull the proverbial carpet out from underneath them”


Enjoy!








































































































































































































Wednesday, August 17, 2011

Using a LAMP server as a free and powerful way to power your websites












LAMP stands for:
• Linux
• Apache
• MySQL
• P (can mean PHP or PERL)



Looking for a powerful and reliable web server solution that is cheap (Free) as well?

LAMP servers are an outstanding choice for your web servers’ needs.

What it will take to get your LAMP web server up and running will be less time and effort than you would think so lets get started!

Got a VM? Old PC or server lying around?

A LAMP web server can be installed on virtually any lower-end hardware and still serve as a fairly powerful server.

Of course if you will need to gauge the hardware specs around your expected traffic.

Moreover, if you currently have a virtualization platform (Vmware, Xen, Hyper-V, etc), this would be a great time to whip up a small and scalable virtual machine to suit the requirement!

If you are in a rush, like most of us in IT are, you can install a full LAMP server on a Ubuntu server install with a single command:

sudo tasksel

You will need to select LAMP from the list and you will be prompted for a "MySQL" password.

Pretty easy eh?

If you are one of those guys or gals who like to have more of a command and control feeling to their install, you can accomplish that with the following method. ~

There are two ways to install a LAMP. One is from the command line and the other is using the tasksel tool.

The “L”

Decide what flavor Linux distribution you prefer and install the OS.
I generally use Ubuntu server, and will be giving instruction based on that.

Once installed you are ready to install your Apache server.

The “A”

Apache is easy to install.

Log in to your console or open up a terminal window and enter the following command:

sudo apt-get install apache2

Enter your sudo user password to complete the installation.

By pointing a web browser to that server IP address, you will be able to ensure your Apache server is up and running.



The “P”

We will choose PHP for this installation.

To do this we will issue the following command(s) from a console or terminal session:

sudo apt-get install php5 libapache2-mod-php

Restart Apache with the command:

sudo /etc/init.d/apache2 restart

To test your PHP install, create a file in the Apache document root (/var/www) called installtest.php. The contents of this file will be:

< ?php phpinfo(); ?>

Save that file and then point your browser to http:/ip address of server/installtest.php
You should see “Test PHP Page” written on your browsers page.

The “M”

Last but not least we will install “MySQL”.

Issue the command:

sudo apt-get install mysql-server

Set a password for "MySQL" with the command:

mysql -u root

This command will place you in the “MySQL” prompt (mysql> )
From the mysql> prompt type:

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('YOURPASSWORDOFCHOICEENTEREDHERE');

Crank up your “MySQL” server with the command:

/etc/init.d/mysql start


I know... I know LAMP is not spelled LAPM, but whatever...

Whether you chose the quick “one-liner” command or broke it down into the down and dirty component, that’s it, your LAMP server is up and running.

Enjoy!!!!


















Saturday, July 3, 2010

Something you can do if you convert (P2V) a physical Windows XP or Windows Server 2003 machine to a VMware virtual machine (VM) and it will not boot!

SO..... You just performed a Physical to Virtual (P2V)conversion of a computer and when you when to boot it (Crickets chirping)..... It did not come up!

Perhaps what you saw instead in the Vsphere Client Console was a black screen with only a dash (-) ?

Sometimes the road to virtualization and consolidaton of your infrasturcture as like real roads has "pot holes"..... This can be one of them :(

We have hit this problem before and 7 out of 10 times the following has been the problem and the resolution:

Master Boot Record (MBR)

The MBR basically is the partition or sector(the first) on a hard drive which contains the code the BIOS uses to boot an OS from the drive.

Problems with the MBR of a system may prevent the system from booting. Sometimes during the conversion process (using the vmware converter standalone) this happens.

What I usually do when this happens is I mount an .iso in the vSphere client for the OS that is affected (i.e. XP Pro, Windows Server 2003, etc) and start a recovery console session.

Heres How:

Boot with the Windows XP or Windows Server 2003 installation CD.

Shortly after the "Press any key to boot from CD" prompt you will be propted for a "Recovery Console Session" (believe it is F2), or you can wait till you are later prompted to press R to repair a Windows XP or Windows Server 2003 installation.

If you have multiple operating systems on your machine be sure to select the appropriate one from the menu. You will need to know the local administrator password when prompted!

Once you have got past that point you will be presented with a command prompt.

At the command prompt enter the command "fixmbr" (no quotes). After the warning messages of possible doom and gloom that will be displayed next, type "Y" and press "Enter" to start the repair process.

After it completes just type "Exit" to leave the recovery console rebooting your machine/vm.

Hope this helps!