SSH key

We had to disable password login to our **** server due to malicious internet attacks. now works with ssh-keys only: here’s how you can setup a ssh key pair from within our TELIN department only.

First check if you have the following open source programs installed: Git Bash, PuTTY, PuTTYgen and WinSCP (and any text editor like Notepad++).

1. Generate a public/private key pair with Git Bash.

  1. Open Git Bash Here from the menu or by right-clicking on the Desktop window.
  2. Issue ssh-keygen -b 4096 -t rsa -N '' -f ~/.ssh/id_rsa in the Git Bash Here window.
  3. Issue ssh-copy-id <your_username>@<workgroup_fileserver>. Replace <your_username> with your TELIN username and <workgroup_fileserver> with your TELIN workgroup server e.g. ddcmfs, digcomfs, gaimfs, ipifs, smacsfs or packages.
  4. Accept the connection with yes
  5. Type your TELIN password.
Your PC should now recognized by the TELIN server. You can try with ```ssh``` and after accepting the connection with **yes** you should be logged in. Exit with the ```exit``` command.

2. Reuse your public/private key pair for PuTTY and WinSCP.

**PuTTY** and **WinSCP** use some different version of the key, they call is **PPK**.
  1. Open PuTTYgen
  2. Select Convertions -> Import Key from the menu.
  3. Search the id_rsa file in C: -> Users -> your_username -> .ssh
  4. Save the private key in the same location. There is a button for it. You can call it telin.ppk

3. In WinSCP connect to

  1. type in the Host name: dialog.
  2. type your username in User name.
  3. Tick the 3 dots in Private key file
  4. Select the telin.ppk file in .C: -> Users -> your_username -> .ssh.
  5. Save the session for later with the Save button.
You should be able to login with the **Login** button now. The left panel is showing your local disk and the right panel is showing your **home** directory. You can copy by selecting any file or directory and select the **F5 Copy** button on the bottom menus.

4. In WinSCP you can connect to the terminal with Manage and Open in PuTTY.

The save session will then also be available in PuTTY under WinSCP temporary session, which you can Load, rename to and Save it again.

If you want to do it manually, type the hostname, select the telin.ppk file you used as private key in Private key file for authentication: with Browse and save the session for later by not logging in yet, but select Session and giving it a name first.

You can mail the **telin.ppk** file to yourself for later use, it's a plain text file! The key on the server is stored in **.ssh/authorized_keys**, it's again a text file and you can add or delete keys manually.