Install and set up an SSH server

dbForge Data Compare for MySQL allows simple and convenient installation and setup of SSH servers.

To install an SSH Server

1. Download SSH Server from www.openssh.org.

2. Unzip the archive and run setup.exe.

3. Accept all the default settings. The files will be placed in C:\Program Files\NetworkSimplicity.

To set up an SSH Server

1. Open the command prompt via Start > Run > cmd.

2. Type the following text to go to your installation directory (by default, it is C:\Program Files\NetworkSimplicity):

c:

cd \program files\networksimplicity

3. Go to the SSH subdirectory by typing the following:

cd ssh

4. Use mkpasswd to configure the passwd file. For example, to let a local user jordansanders login, type the following:

mkpasswd -l -u jordansanders >> ..\etc\passwd

If jordansanders is a domain user, type the following:

mkpasswd -d -u jordansanders >> ..\etc\passwd

Note

If you are using a domain controller, it is recommended to use the -d option rather than the -l option. Though -l is a valid option for domain accounts, you can end up having a spurious group ID associated with your username.

If you want to use mkpasswd with a user that is not in your primary domain, then you must use a different syntax. For example, this is how it works for a user called jordansanders from a trusted domain trustdomain:

mkpasswd -d -u jordansanders trustdomain >> ..\etc\passwd

Do this for all users that must be able to login. You can copy these files to other OpenSSH as long as the users are identical.

5. Use mkgroup to create a group file. Type the following for local groups:

mkgroup -l >> ..\etc\group

And the following works for domain groups:

mkgroup -d >> ..\etc\group

If you do both, open the file in Notepad and remove any duplication.

6. Reboot the server by typing:

net stop opensshd

net start opensshd

7. Test the connection from another machine by typing the following:

cmd ssh user@just_install_server

8. Use a special key generator (such as PuTTYgen) to generate public and private keys in the OpenSSH format. They are used to provide authentication between the SSH server and the client.

Note

If you are using PuTTYgen, you can either convert a generated private key to the OpenSSH format (by selecting Conversions > Export OpenSSH key from the menu) or use keys without conversion. Data Compare supports both options.

In the public key file, copy the public key located between the following lines:

BEGIN SSH2 PUBLIC KEY

Comment: rsa-key-20090714

this is the line where the required public key will be

END SSH2 PUBLIC KEY

9. Create an authorized_keys.pub file in the C:\Program Files\NetworkSimplicity\ssh.ssh\ directory. This file will contain the public key used by the SSH server to authenticate the client and give access to the MySQL server. In this file, type the following:

ssh-rsa your public key user@user

10. Open the file C:\Program Files\NetworkSimplicity\ssh\sshd_config and specify the location of the authorized_keys.pub file:

AuthorizedKeysFile    /ssh/.ssh/authorized_keys.pub

11. If you want to use SSH connections with password authentication, make sure your server supports this authentication. The PasswordAuthentication line in the sshd_config file must contain yes.

12. Reboot the server by typing the following:

net stop opensshd

net start opensshd

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge Data Compare for MySQL.
Request a demo

Request a demo

If you consider employing the Data Compare for your business, request a demo to see it in action.
Ready to start using dbForge Data Compare for MySQL?