Skip Headers
Oracle® Enterprise Manager Cloud Control Basic Installation Guide
12c Release 1 (12.1.0.1)

Part Number E22624-08
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

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:

Overview

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.

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 that source host.

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.

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 an SSH connectivity (Secure Shell) between the destination host and the host running Oracle Management Service (OMS). Using this connectivity, the wizard transfers the software binaries to the destination host over SSH protocol, and installs and configures the Management Agent.

Caution:

Ensure that your password-enabled SSH connection is set up between the host and OMS, and not between destination hosts.

In Enterprise Manager Cloud Control, the Add Host Targets Wizard automatically sets up and drops the SSH connectivity. Therefore, all you need to do is, manually install Cygwin on the destination host and start the SSH Daemon on it.

Note:

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

Installing Cygwin

To install Cygwin, follow these steps:

Before starting with the SSHD setup, ensure you are not using OpenSSH and MKSNT when using the Add Host Targets Wizard. The Add Host Targets Wizard uses the complete Cygwin suite (full collection of the software tools packaged in Cygwin).

To get the complete collection of Cygwin, do the following:

  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:

    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 service and click Stop.

      Note:

      Ensure you rename the installation directories of OpenSSH and mksnt.
  3. Visit 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.

    While installing Cygwin, ensure that you select the following packages in the Select Packages screen:

    1. From the Archive category, select unzip and zip.

      Figure 5-1 Zip Unzip Binaries

      Zip Unzip Binaries
    2. From the Net category, select openssh.

      Figure 5-2 Net Packages

      Net Packages
  4. After you install Cygwin, navigate to the C:\cygwin directory, open the cygwin.bat file using the Notepad utility, and edit it to add the following line:

    set CYGWIN=binmode tty ntsec

  5. Open the Cygwin Bash Shell and verify whether cygrunsrv is installed:

    bash
    cygrunsrv -h
    

    Note:

    If you are prompted to provide a Cygwin value, enter binmode tty ntsec. If this returns an error message stating service does not exist, you are on the right track, and can proceed to the next step.
  6. Open a new command prompt and run the following:

    -bash
    -ssh-host-config
    

    Note:

    Enter no when prompted to create sshd user account (message reads sshd user account needs to be created).

    Enter yes for all other prompts.

    When prompted to answer the question Which value should the environment variable CYGWIN have when sshd starts?, Oracle recommends that you set the value to at least ntsec as shown in the following example. This will enable you to change the user context without having to specify the password.

    As an answer to the previously mentioned question, specify a value that is similar to the following and press Enter:

    CYGWIN="binmode tty ntsec"
    
  7. Now, open the /etc/passwd file, and remove only those entries of the user that you will use to connect to the OMS machine.

    For example,

    • If the user that you are employing to connect to the OMS machine is a local user, execute the following:

      /bin/mkpasswd -l –u <USER> >> /etc/passwd
      
    • If the user you are employing to connect to the OMS machine is a domain user, execute the following:

      /bin/mkpaswd.exe -d -u <USER> >> /etc/passwd
      /bin/mkgroup.exe -d >> /etc/group
      
      
      mkdir -p /home/<USER>  (for example, mkdir -p /home/pjohn)
      chown <USER> /home/<USER> (for example, chown pjohn /home/pjohn)
      
  8. Start the SSH daemon.

    If the user you are employing to connect to the OMS machine is a domain user, do the following:

    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. Change the permission of /etc/ssh_host_rsa_key. It is recommended that you do not allow private key files to be accessible by others.

      Now, go to the CYGWIN command prompt, and execute the following:

      chmod 644 /etc/ssh*
                 chown <USERNAME> /var/empty
         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 command:
      chmod 644 /var/log/sshd.log
      
    7. Start the SSH daemon by executing:

      /usr/sbin/sshd
      

      Alternatively, from the same BASH prompt, you can also execute:

      cygrunsrv -S sshd
      

      Note:

      Use cygrunsrv -E sshd to stop the SSH daemon.
  9. 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.

Setting Up the Timezone Variable on Remote Hosts

To verify if the timezone environment variable (TZ) is accessible by the SSH server on the remote hosts, execute the following command from the OMS host:

ssh -l <user_name> -n <remote_node> 'echo $TZ'

If this command does not return the TZ environment variable value, you must set the TZ variable and ensure this is accessible by the SSH server. You can set the TZ environment variable on remote hosts in the following sections:

Set the TZ variable and Restart the SSH Daemon

If the shell being used is BASH, add the following line to the .bashrc file in the home directory of the user (being used) for ssh access:

export TZ=<your machine's timezone>

If you are using a CSH shell, then add the following line to the .cshrc file in that directory:

setenv TZ <your machine's timezone>
  1. Depending on the shell that is present on the host, set the TZ variable by running the following command. In the following command, PST8PDT is only an example.

    For a CSH Shell, specify:
    setenv TZ PST8PDT
    
  2. Restart the SSH daemon by executing:

    sudo /etc/init.d/sshd restart
    
  3. Now, execute the following command from the OMS home to verify if the SSH server can access the TZ variable.

    ssh -l <user_name> -n <node_name> 'echo $TZ'
    

Set the TZ Variable in the "Shell rc" File

The timezone variable must be set in the rc file of the shell that the host is using.

For example, if the host is using a BASH shell, go to the user's home directory ($HOME) and add the following to the ~/.bashrc file to set the TZ variable:

TZ=PST8PDT; export TZ

If the host is using a CSH shell, go to $HOME and add the following to the ~/.cshrc file:

setenv TZ PST8PDT

Now, execute the following command from the OMS home to verify if the SSH server can access the TZ variable.

ssh -l <user_name> -n <node_name> 'echo $TZ'