Skip Headers
Oracle® Enterprise Manager Cloud Control Basic Installation Guide
12c Release 1 (12.1.0.1)
E22624-12
  Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
 
Next
Next
 

5 Installing Cygwin and Starting SSH Daemon

This chapter explains how you can install Cygwin and start the SSH daemon on Microsoft Windows hosts. In particular, this chapter covers the following:


Note:

This chapter is applicable only for the following cases:
  • When the destination host on which you are installing a Management Agent is running on Microsoft Windows.

  • When the OMS host from where you are accessing the Add Host Targets Wizard is running on Microsoft Windows.


Overview

The Add Host Targets Wizard is an application built into the Enterprise Manager Cloud Control console. It offers GUI-rich, interactive screens to enable you to install Management Agents on unmanaged hosts and convert them to managed hosts so that they can be monitored and managed in Enterprise Manager Cloud Control.

When you use the Add Host Targets Wizard to install Oracle Management Agent (Management Agent) on a destination host that is running on Microsoft Windows, as a prerequisite, you are expected to have Cygwin installed and the SSH Daemon started on that destination host. To do so, follow the steps listed in Installing Cygwin.

Similarly, when you use the Add Host Targets Wizard to install from an OMS host that is running on Microsoft Windows, as a prerequisite, you are expected to have Cygwin installed on the source host. Cygwin should also be installed and the SSH Daemon started on the destination host. To do so, follow the steps 1 to 3 listed in section Installing Cygwin.

Cygwin is essentially a utility that offers a Linux-like environment on a Microsoft Windows operating system. Technically, it is a DLL (cygwin1.dll) that acts as a Linux API layer providing substantial Linux API functionality. Once you install Cygwin, you can configure the SSH Daemon on it.

The SSH Daemon enables the Add Host Targets Wizard to establish SSH connectivity between the OMS host and the destination host where you want to install the management agent. Using this connectivity, the wizard transfers the software binaries to the destination host over SSH protocol, and installs and configures the Management Agent.


Note:

The Add Host Targets Wizard is certified and supported with Cygwin 1.7.

Before You Begin

Before starting with the SSHD setup, ensure you are not using OpenSSH and MKSNT when using the Add Host Targets Wizard. To do so, perform the following checks:

  1. Ensure OpenSSH\bin and mksnt are not in your PATH environment variable. If they are, remove them by doing the following:

    1. Right-click on My Computer and go to Properties.

    2. In the System Properties window, click Advanced.

    3. In this tab, click Environment Variables.

    4. Here, search for the PATH system variable, select it, and if the OpenSSH\bin and mksnt are present in the PATH, click Edit.

    5. In the Edit System Variable dialog box, delete these two values from the PATH, and click OK.

  2. Stop the SSH Daemon if it is running from OpenSSH, MKS or any other vendor. If the SSH Daemon is running, stop it by doing the following:

    1. Right-click on My Computer, and select Manage.

    2. In the Computer Management window, in the left pane, expand Services and Applications, and select Services.

    3. In the right pane, right click the SSH Daemon/MKS Secure Shell service and click Stop.


      Note:

      The navigational steps described above may vary for different Microsoft Windows operating systems.

Installing Cygwin

To install Cygwin and start the SSH daemon on Microsoft Windows hosts, follow these steps:

  1. Download the setup.exe file corresponding to Cygwin 1.7 from the following Web site, and install the Cygwin software in the C:\cygwin directory:

    http://www.cygwin.com


    Note:

    If you install Cygwin in a different directory on the destination host, then do the following:

    (a) Ensure that you update the $<OMS_HOME>/oui/prov/resources/ssPaths_msplats.properties file with the proper Cygwin binary values after installing the Enterprise Manager system.

    (b) If the OMS as well as the target is on Microsoft Windows, ensure that Cygwin is installed in the same location on the OMS host.


    1. Invoke Cygwin setup, and click Next to proceed.

      Surrounding text describes cygwin1.gif.
    2. On the Choose Installation Type screen, select Install from Internet, and click Next.

      Surrounding text describes cygwin2.gif.
    3. On the Choose Installation Directory screen, enter C:\cygwin as the Root Directory, and click Next.

      Surrounding text describes cygwin3.gif.
    4. On the Select Local Package Directory screen, select a directory on your local machine where you want the Setup to store the installation files it downloads, and click Next.

      Surrounding text describes cygwin4.gif.
    5. On the Select Connection Type screen, select appropriate settings to connect to the internet, and click Next.

      Surrounding text describes cygwin5.gif.
    6. On the Choose Download Site(s) screen, select any site from the available list, and click Next.

      Surrounding text describes cygwin6.gif.
    7. On the select packages screen, ensure that you select the following packages, and click Next:

      From the Archive category, select unzip and zip as follows:

      Surrounding text describes cygwin8a.gif.

      From the Net category, select openssh as follows:

      Surrounding text describes cygwin8b.gif.

      After selecting the packages, a Resolving Dependencies screen is displayed. Click Next to proceed.

    8. On the Installation Status and Create Icons screen, do not make any changes. Click Finish to complete the installation process.

      Surrounding text describes cygwin10.gif.
  2. After you install Cygwin, navigate to the C:\cygwin directory, open the Cygwin.bat file in edit mode, and add the following line before invoking the bash shell.

    set CYGWIN=binmode ntsec

    For example, here are the contents for the Cygwin.bat file after adding the above line:

    @echo off
    C:
    chdir C:\cygwin\bin
    set CYGWIN=binmode ntsec
    bash --login -i
    
  3. To verify if Cygwin (cygrunsrv) is installed properly, run C:\cygwin\Cygwin.bat, and execute the following command:

    cygrunsrv -h
    

    If Cygwin is installed properly, then all the Cygwin help options are displayed on the screen. However, if this returns an error message, then it means you are not on the right track, and might have to reinstall Cygwin.

  4. To install SSHD service, run C:\cygwin\Cygwin.bat, and execute the following command:

    ssh-host-config
    

    After running the command, you are prompted the following questions:

    *** Query: Should privilege separation be used? <yes/no>: yes
    *** Query: New local account 'sshd'? <yes/no>: yes
    *** Query: Do you want to install sshd as a service?
    *** Query: <Say "no" if it is already installed as a service> <yes/no>: yes
    *** Query: Enter the value of CYGWIN for the deamon: [] binmode ntsec
    *** Info: 'cyg_server' will only be used by registered services.
    *** Query: Do you want to use a different name? (yes/no) yes
        (Note: At this point you will be prompted to create a new user)
    *** Query: Create new privileged user account 'cyg_server'? (yes/no) yes
    *** Info: that this password matches the password rules given on your system.
    *** Info: Entering no password will exit the configuration.
    *** Query: Please enter the password:
    ***Query: Renter:
    

    If the configuration is successful, you will see the following message:

    Host configuration finished. Have fun!
    
  5. Backup the /etc/passwd file and then use a vim or vi editor to open it in edit mode. Remove only those entries of the user that you will use to connect to the destination host on which you want to install the Management Agent. Ask the user to make a backup of the /etc/passwd file before editing.

    • If the user that you are employing to connect to the destination host on which you want to install the Management Agent is a local user, run C:\cygwin\Cygwin.bat and execute the following:

      /bin/mkpasswd -l –u <USER> >> /etc/passwd
      
    • If the user you are employing to connect to the destination host on which you want to install the Management Agent running is a domain user, run C:\cygwin\Cygwin.bat and execute the following:

      /bin/mkpasswd -d -u <USER> >> /etc/passwd
      /bin/mkgroup -d >> /etc/group
      
      
      mkdir -p /home/<USER>  (for example, mkdir -p /home/pjohn)
      chown <USER> /home/<USER> (for example, chown pjohn /home/pjohn)
      
  6. (domain user only) If the user you are employing to connect to the destination host on which you want to install the Management Agent is a domain user, do the following to start the SSH daemon:

    1. Right-click on My Computer, and select Manage.

    2. In the Computer Management dialog box that appears, go to Services and Applications, and select CYGWIN sshd.

    3. Right-click CYGWIN sshd and select Properties.

    4. In the Properties dialog box, go to the Log On tab.

    5. Here, specify the domain/user name and password. Click Apply.

    6. Run C:\cygwin\Cygwin.bat, and execute the following:

      chown <USERNAME> /var/log/sshd.log
      chown -R <USERNAME> /var/empty
      chown <USERNAME> /etc/ssh*
      chmod 755 /var/empty
      chmod 644 /var/log/sshd.log
      

      Note:

      If /var/log/sshd.log does not exist, you do not have to execute the following commands:
      chown <USERNAME> /var/log/sshd.log
      chmod 644 /var/log/sshd.log
      

  7. Perform one of the following steps to start the SSH daemon:

    Run C:/cygwin/Cygwin.bat and execute the following command:

    /usr/sbin/sshd

    OR

    Run C:/cygwin/Cygwin.bat and execute the following command:

    cygrunsrv -S sshd

    OR

    Perform these steps:

    1. Right-click on My Computer, and select Manage.

    2. In the Computer Management dialog box that appears, go to Services and Applications, and select CYGWIN sshd.

    3. Right-click CYGWIN sshd and select Start.

  8. You can now test your Cygwin setup.

    To do this, go to a different machine (that has the ssh client running), and execute the following command:

    ssh -l <USERNAME> <localhost> 'date'
    
    OR
    
    ssh -l <USERNAME> <this node> 'date'
    

    For example,

    ssh -l pjohn example.com 'date'
    

    This command will prompt you to specify the password. When you specify the correct password, the command should return the accurate date.