Installing and Setting Up SSH Server
Last modified: November 2, 2023
To install SSH Server:
- Download SSH Server at www.openssh.org.
- Unzip setup.exe and run it.
- Accept all the default settings. This places all appropriate files in C:\Program Files\NetworkSimplicity.
To set up SSH Server:
- Open a command prompt by using Start -> Run -> cmd.
-
Type the following to go to your install directory (by default, it is C:\Program Files\NetworkSimplicity):
c:
cd \program files\networksimplicity
-
Go into the ssh subdirectory by typing:
cd ssh
-
Use mkpasswd to tune the passwd file. For example, to allow a local user localjoe to login, type the following:
mkpasswd -l -u localjoe » ..\etc\passwd
To allow a domain user “domainbob” to login, type:
mkpasswd -d -u domainbob » ..\etc\passwd
If you are on a domain controller, it is recommended to use the -d option, rather than the -l option. Though -l is a valid option on a domain controller for domain accounts you can end up having a spurious group ID associated with your username.
Note
If you want to use mkpasswd with a user that is not in your primary domain then you must use a different syntax. If you wanted to get user jdoe from trusted domain trustdomain you would type:
mkpasswd -d -u jdoe trustdomain » ..\etc\passwd
Do this for all users that should be able to login. You can copy these files to other OpenSSH on Windows installations as long as the users are identical.
-
Use mkgroup to create a group file. Type the following for local groups:
mkgroup -l » ..\etc\group
For domain groups:
mkgroup -d » ..\etc\group
If you do both, open the file in notepad and remove any duplication.
-
Reboot the server by typing:
net stop opensshd
net start opensshd
-
Test the connection from another machine by typing:
cmd ssh user@just_install_server
-
Use a special key generator, for example PuTTygen, to generate public and private keys in OpenSSH format. They are used to provide authentication between the SSH Server and client. Note if you are using PuTTygen, you can either convert a generated private key into OpenSSH format (by selecting Conversions>Export OpenSSH key in the menu) or use the keys without conversion. dbForge Studio supports both formats.
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 public key to copy
END SSH2 PUBLIC KEY
-
Create authorized_keys.pub file in C:\Program Files\NetworkSimplicity\ssh.ssh\ folder. This file will contain a public key used by the SSH Server to authenticate the client and give access to the MySQL Server. In the file type the following:
ssh-rsa your public key user@user
-
Open C:\Program Files\NetworkSimplicity\ssh\sshd_config file and specify the location of authorized_keys.pub file:
AuthorizedKeysFile /ssh/.ssh/authorized_keys.pub
- If you want to use SSH connections with password authentication, check that your server supports this authentication. PasswordAuthentication line in sshd_config file should contain yes.
-
Reboot the server by typing:
net stop opensshd
net start opensshd
Want to find out more?
Overview
Take a quick tour to learn all about the key benefits delivered by dbForge Studio for MySQL.
All features
Get acquainted with the rich features and capabilities of the tool in less than 5 minutes.
Request a demo
If you consider employing this tool for your business, request a demo to see it in action.