- Ssh клиент для windows cygwin
- To Download and Install Cygwin
- To Set the Path for Windows and for the Cygwin Shell
- To Set the Home Directory for the Cygwin SSH User
- To Configure and Start the Cygwin SSH Server Daemon sshd
- 5 Installing Cygwin and Starting the SSH Daemon
- 5.1 About the Cygwin Requirement for Installing Management Agents
- 5.2 Be fore You Begin Installing Cygwin
- 5.3 Installing Cygwin
- 5.4 Confi guring SSH
- 5.5 After Inst alling Cygwin and Configuring SSH
Ssh клиент для windows cygwin
Set up Cygwin SSH on the DAS host and on all hosts where instances in your cluster will reside.
The following topics are addressed here:
To Download and Install Cygwin
For centralized GlassFish Server administration, a basic Cygwin installation that includes the SSH client and the SSH server daemon sshd is sufficient. The default installation options are sufficient to create such a basic installation.
- Log in as a user with Administrator privileges.
- Create the folder C:\cygwin.
- From the Cygwin home page, download and save the setup.exe file to your desktop.
- Run the setup.exe file.
- Select the default for the following options:
Install from Internet
Install Root Directory: C:\cygwin
Install for All Users
For example, if the host is connected to the Internet through a proxy server, specify the proxy server.
- Under the Net category, search for openssh.
- Locate the openssh package and click Skip.
The package is selected.
Any unsatisfied dependencies are listed.
Leave the Select Required Packages option selected and click Next
The packages are installed.
For detailed information about installing Cygwin, seeInternet Setup in Cygwin User’s Guide.
To Set the Path for Windows and for the Cygwin Shell
To enable GlassFish Server tools to find commands for SSH, each user’s path for Windows and for the Cygwin shell must contain the following directories:
The Cygwin bin directory, for example C:\cygwin\bin
The bin directory of the JDK software
- Log in as a user with Administrator privileges.
Logging in as a user with Administrator privileges ensures that the change applies to all users.
The Cygwin bin directory, for example C:\cygwin\bin
The bin directory of the JDK software
To Set the Home Directory for the Cygwin SSH User
The SSH Server Daemon sshd locates a user’s home directory from the configuration in the user database, not from environment variables such as HOME. To ensure that all GlassFish Server commands can run without errors, each SSH user must be configured to have a home directory.
Each user on a Windows host where SSH is set up potentially has two home directories:
Windows home directory. GlassFish Server commands, which are run in a Windows command window, use the Windows home directory.
SSH home directory. SSH commands, which are run in a shell such as bash or ksh, use the SSH home directory.
If these home directories are different, GlassFish Server and SSH each locate a user’s .ssh directory in different directories. To simplify the set up of SSH, configure each user’s home directory for SSH and Windows to be the same directory. A disadvantage of this approach is that the SSH home directory has spaces in its path name. Spaces in path names are cumbersome in the UNIX environment.
- Log in as a user with Administrator privileges.
- In the c:\cygwin\etc\passwd file, edit the home directory setting for the SSH user to specify the user’s home directory for Windows.
To Configure and Start the Cygwin SSH Server Daemon sshd
Before You Begin
Ensure that the following prerequisites are met:
A user account is created for each user that will log in to the host through SSH.
A password is set for each user account.
The SSH server daemon sshd disallows authentication of any user for whose account a password is not set.
- Double-click the Cygwin icon.
A Cygwin terminal is started.
If necessary, set the password for your user account.
- Run the passwd command as follows: user-name
The user name for your account.
The password for your Windows account is also set.
Configure SSH on the host.
- Run the ssh-host-config command.
Tip — If you are using Windows XP, specify the -y option of ssh-host-config to answer yes to all prompts. If you run ssh-host-config with the -y option, omit Step b.
The file /etc/ssh_config can also be accessed as /cygdrive/c/cygwin/etc/sshd_config.
After you have completed the setup of SSH on a host, test the setup on the host as explained in Testing the SSH Setup on a Host.
5 Installing Cygwin and Starting the SSH Daemon
This chapter explains how to install Cygwin and start the SSH daemon on Microsoft Windows hosts. This chapter is applicable only when you want to install a Management Agent on a Microsoft Windows host, using the Add Host Targets Wizard or EM CLI. In particular, this chapter covers the following:
If you do not want to install Cygwin to deploy Management Agents on Microsoft Windows hosts using the Add Host Targets Wizard or EM CLI, you can choose to deploy Management Agents on these hosts using the PsExec process utility. For information on how to deploy Management Agents on Microsoft Windows hosts using PsExec, see Appendix F.
5.1 About the Cygwin Requirement for Installing Management Agents
The Add Host Targets Wizard is an application built into the Enterprise Manager Cloud Control console. It offers GUI-rich, interactive screens that enable you to install Oracle Management Agents (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 or EM CLI to install a Management Agent on a host running on Microsoft Windows, as a prerequisite, you must install Cygwin and start the SSH Daemon on the host. To do so, follow the steps listed in Section 5.3.
Cygwin is essentially a utility that offers a Linux-like environment on a Microsoft Windows host. 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 the host. The Add Host Targets Wizard is certified and supported with Cygwin 1.7.
The SSH Daemon enables the Add Host Targets Wizard to establish SSH connectivity between the OMS host and the host on which you want to install a Management Agent. Using this connectivity, the wizard transfers the Management Agent software binaries to the destination host over SSH protocol, installs the Management Agent, and configures it.
5.2 Be fore You Begin Installing Cygwin
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:
Ensure OpenSSH\bin and mksnt are not in your PATH environment variable. If they are, remove them by doing the following:
Right-click on My Computer and go to Properties .
In the System Properties window, click Advanced.
In this tab, click Environment Variables.
Here, search for the PATH system variable, select it, and if the OpenSSH\bin and mksnt are present in PATH, click Edit.
In the Edit System Variable dialog box, delete these two values from PATH, then click OK.
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:
Right-click on My Computer , and select Manage.
In the Computer Management window, in the left pane, expand Services and Applications , and select Services .
In the right pane, click the SSH Daemon/MKS Secure Shell service, then click the Stop button.
The navigational steps described in this section may vary for different Microsoft Windows operating systems.
5.3 Installing Cygwin
To install Cygwin on a Microsoft Windows host, follow these steps:
Access the following URL, then click Install Cygwin:
Download the 32-bit version (if you are running a 32-bit version of Microsoft Windows) or the 64-bit version (if you are running a 64-bit version of Microsoft Windows) of the Cygwin setup executable.
Run the setup executable, then click Next to proceed.
On the Choose Installation Type screen, select Install from Internet, then click Next.
On the Choose Installation Directory screen, enter C:\cygwin as the Root Directory, then click Next.
If you choose to install Cygwin in a different directory, then ensure that you update the SSH_PATH, SCP_PATH, MKDIR_PATH, SH_PATH, CHMOD_PATH , and TRUE properties present in the $ \oui\prov\resources\ssPaths_msplats.properties file to their proper Cygwin binary values, after installing the Enterprise Manager system.
For example, if you choose to install Cygwin in the D:\software\cygwin directory, then update the specified properties in the following manner:
On the Select Local Package Directory screen, select a directory on your local machine where you want to store the downloaded installation files, then click Next.
On the Select Connection Type screen, select appropriate settings to connect to the internet, then click Next.
On the Choose Download Site(s) screen, select any site from the available list, then click Next.
On the select pac kages screen, ensure that you select the following packages, then click Next :
From the Archive category, select unzip and zip as follows:
From the Net category, select openssh and openssl as follows:
After selecting the packages and clicking Next, the Resolving Dependencies screen is displayed. Click Next to proceed.
On the Installation Status and Create Icons screen, do not make any changes. Click Finish to complete the installation process.
5.4 Confi guring SSH
This section describes how to configure SSH and test your Cygwin setup after installing Cygwin on a host.
While configuring SSH, you may need to run the cygwin.bat script. While running cygwin.bat in Microsoft Windows Server 2008 and Microsoft Windows Vista, ensure that you invoke it in administrator mode. To do this, right-click the cygwin.bat file and select Run as administrator.
To configure SSH and test your Cygwin setup, follow these steps:
After you install Cygwin, navigate to the C:\cygwin directory, open the Cygwin.bat file in edit mode using any editor, 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:
To verify if Cygwin ( cygrunsrv) is installed properly, run C:\cygwin\Cygwin.bat , and execute the following command:
If Cygwin is installed properly, then all the Cygwin help options are displayed on the screen. However, if this command returns an error message, then you may have to reinstall Cygwin.
To configure the SSHD service, run C:\cygwin\Cygwin.bat , and execute the following command:
After running the command, you are prompted the following questions:
At this point, if you want to use the same name, that is cyg_server, enter no. You are then prompted the following questions:
However, if you want to use a different name, enter yes. You are then prompted the following questions:
If the configuration is successful, you will see the following message:
Backup the c:\cygwin\etc\passwd file and then use any editor to open the file in edit mode. Remove only those entries of the user that you will use to connect to the host on which you want to install a Management Agent. Ask the user to make a backup of the c:\cygwin\etc\passwd file before editing.
If the user that you are employing to connect to the host on which you want to install the Management Agent is a local user, run C:\cygwin\Cygwin.bat and execute the following:
If the user you are employing to connect to the host on which you want to install the Management Agent running is a domain user, run C:\cygwin\Cygwin.bat and execute the following:
(Only if the Cygwin software you have installed is of version 1.7.32 or higher) Open C:\cygwin\etc\sshd_config in a text editor and add the following line to the end of the file:
(For a domain user only) If the user you are employing to connect to the host on which you want to install the Management Agent is a domain user, do the following to start the SSH daemon:
Right-click on My Computer , and select Manage .
In the Computer Management dialog box that appears, go to Services and Applications, and select CYGWIN sshd .
Right-click CYGWIN sshd and select Properties .
In the Properties dialog box, go to the Log On tab.
Here, specify the domain/user name and password. Click Apply.
Run C:\cygwin\Cygwin.bat , and execute the following:
If /var/log/sshd.log does not exist, you do not have to execute the following commands:
Perform one of the following steps to start the SSH daemon:
Run C:\cygwin\Cygwin.bat and execute the following command:
Run C:\cygwin\Cygwin.bat and execute the following command:
cygrunsrv -S sshd
Perform these steps:
Right-click on My Computer , and select Manage .
In the Computer Management dialog box that appears, go to Services and Applications, and select CYGWIN sshd .
Click CYGWIN sshd, then click the Start button.
If the SSH daemon does not start up, view the c:\cygwin\var\log\sshd.log file for information on why the start up failed.
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:
This command will prompt you to specify the password. When you specify the correct password, the command should return the accurate date.
If you experience a process fork failure, memory leak error, or a file access error after configuring SSH, view the following website for a workaround:
If you are unable to find a workaround for your problem, report your problem to the Cygwin community using the following website:
5.5 After Inst alling Cygwin and Configuring SSH
After installing Cygwin (as described in Section 5.3) and configuring SSH (as described in Section 5.4), follow these steps:
If the OMS host runs on a Microsoft Windows platform, perform the following on the OMS host:
Right click My Computer, then select Properties. In the window that appears, select Advanced system settings, then select Environment Variables. In the System Variables section, create the CYGWIN variable, and specify its value as nodosfilewarning
You do not need to restart the host after performing this step.
Navigate to the Cygwin install directory (that is, C:\cygwin if you chose to install Cygwin in the default location), open the Cygwin.bat file in edit mode using any editor, then edit the following line:
For example, these are the contents of the Cygwin.bat file after editing the above line:
From the Start menu, select Run. For Open, enter services.msc, then click OK. Search for the Cygwin SSHD service and stop it.
Navigate to the Cygwin install directory (that is, C:\cygwin if you chose to install Cygwin in the default location), then run Cygwin.bat. Run the following command to start the SSHD service:
Running this command may return an error mentioning that /var/empty must be owned by the root user. If you encounter this error, run the following from the Cygwin terminal:
After running this command, retry the $ /usr/sbin/sshd command.
Perform the tasks mentioned in Step 1 on all the Microsoft Windows target hosts (on which you want to install Management Agents using the Add Host Targets Wizard or EM CLI).