Configuring SSH public key authentication
VisualGDB 3.0 and later supports setting up public key authentication automatically. Simply check the “Setup public key autnehtication” when creating a new SSH connection and VisualGDB will do all the work for you.
If you are not using VisualGDB, feel free to use SmarTTY – our free SSH client, to setup the public key authentication with one click.
In case you want to do everything manually, follow the tutorial below:
- Install and start an SSH server on your Linux machine. On debian-based systems this is done by running the following command:
1sudo apt-get install openssh-server
- Start the cygwin shell. Create the .ssh directory in your home directory and test the connection to your Linux machine::
12mkdir ~/.sshssh linuxuser@linuxmachine
- We will now generate a keypair: the public key that will be placed on the Linux machine and the private key that will be stored on the Windows machine. To generate the keypair, type the following command in the Cygwin shell:
1ssh-keygen -t dsa
- Copy the public key to the home directory in your Linux machine by running the following command from cygwin shell:
1scp ~/.ssh/id_dsa.pub linuxuser@linuxmachine:~
- Connect to the Linux machine with ssh and append the id_dsa.pub file to the .ssh/authorized_keys file:
12ssh linuxuser@linuxmachinecat ~/id_dsa.pub >> ~/.ssh/authorized_keys
- Now you can test the SSH authentication by running the following command from Windows machine (can be done outside cygwin shell):
1c:\cygwin\bin\ssh linuxuser@linuxmachine
If you have done everything correctly, ssh will authenticate automatically not requiring you to enter the password.