Software* Setting up PuTTY CTEC1767 Data Communications & Networking CTEC1863 Operating Systems CTEC1906 Internet Computing Microsoft Windows 7 (64-bit) PuTTY 0.70 (64-bit) PuTTYgen 0.70 (64-bit) WinSCP 5.13.1 (32-bit) Version 3.0 Updated for 2018 Spring * as at 2018-05-09 Downoad PuTTY The official PuTTY home page is: http://www.chiark.greenend.org.uk/~sgtatham/putty/ Download PuTTY Download the PuTTY installer (putty-64bit-0.70-installer.msi*) Alternatiely, you can download the putty.zip file. Both contain seeral programs for SSH, SFTP, and SCP. *As at 2018-05-09; 32-bit ersions are also aailable 1
PuTTY Files - Installer PuTTY Files - Installer PuTTY Files Installer (2) PuTTY Files Installer (3) 2
PuTTY Files Installer (4) PuTTY Installed To run PuTTY after using the installer, go to the Programs menu, or, if you elected to install the desktop shortcut, to the Desktop PuTTY Installation Zip File Copy or extract the files from the zip file into a folder that is on your PATH. To find out the PATH, right click on the My Computer icon and select Properties. Then, from the Adanced tag, click on the Enironment ariables button. Or you can type path from a Command prompt window. PuTTY Installation Zip File (2) If you re not sure, just copy the PuTTY files into C:\Windows. That folder is always on the path. To run PuTTY, from the Start menu, select Run and enter putty. 3
Running PuTTY Setting up the Session In the Host Name (or IP address) field, enter technology.niagarac.on.ca or 192.197.62.35. The Port can be 22 (the default, may not work with all College networks) or 443 (recommended -- works both inside and outside the College.) Make sure that SSH is checked off under Connection Type (it is the default). Setting up the Session (2) Window Configuration Change the font size only when maximized Set Lines of scrollback Display scrollbar in full screen mode 4
Window Configuration (2) Change the font to something that you can read (I like Consolas) Window Configuration (3) Set the Window title Select Clear Type for the best anti-aliasing Window Configuration (4a) Set the colours For example, Default Foreground to black (Red = 0, Green = 0, Blue = 0) and Default Background to white (Red = 255, Green = 255, Blue = 255) Window Configuration (4b) Set the colours For example, Default Foreground to black (Red = 0, Green = 0, Blue = 0) and Default Background to white (Red = 255, Green = 255, Blue = 255) 5
Window Configuration (4c) Set the colours For example, Default Foreground to black (Red = 0, Green = 0, Blue = 0) and Default Background to white (Red = 255, Green = 255, Blue = 255) Window Configuration (4d) Set the colours For example, Default Foreground to black (Red = 0, Green = 0, Blue = 0) and Default Background to white (Red = 255, Green = 255, Blue = 255) Window Configuration (4e) Set the colours Don t forget the cursor colours (so that you can see the character that is under the cursor) Window Configuration (4f) Set the colours Don t forget the cursor colours (so that you can see the character that is under the cursor) 6
Connection Settings Enable TCP keepalies (both by sending null packets and with the socket option) Change the Internet protocol ersion to IP4 Connection Settings (2) Enter your username Connection Settings (3) Later, you will set your priate key here Gie the session a name and click Sae; it will be added to the list of Saed Sessions (for future use); Click Open to connect Saing the Settings 7
Gie the session a name and click Sae; it will be added to the list of Saed Sessions (for future use); Click Open to connect Saing the Settings (2) Connecting: First Time You will get the Security Alert popup the first time you connect. This is normal and is a feature of the SSH protocol. Click on the Yes button. PuTTY Command Line Session Public Key Encryption You are prompted for your password. If you get it wrong, try again. Enter (Linux) commands here. Close the window or press Control+D to end the session. Run PuTTYgen to create a key. Click Generate and follow the instructions. As you moe the mouse pointer around here, the progress bar adances Sae the priate key (ignore the warning about a missing passphrase ) 8
Public Key Encryption (2a) Run PuTTYgen to create a key. Public Key Encryption (2b) Run PuTTYgen to create a key. Click Generate and follow the instructions. Sae the priate key (ignore the warning about a missing passphrase ) Click Generate and follow the instructions. Sae the priate key (ignore the warning about a missing passphrase ) A passphrase is some text that you remember and hae to type in, to use your priate key. It is an extra layer of security, that can be used, say, if the priate key file is on a USB flash drie. Priate key file saed on Desktop Public Key Encryption (3) Highlight and copy the Public key with the mouse. Right click, Select All, right click, Copy Public Key Encryption (4) From a PuTTY session, run the following commands then paste using the right mouse button. Press Enter, then Control-D twice (once to sae; the second time to log off) 9
Public Key Encryption (5) Run PuTTY again, but just Load the session, do not Open (connect) yet. Public Key Encryption (6) Set up your priate key file. Click Browse and find your priate key (.ppk) file. Public Key Encryption (7) Sae the session, so that it remembers the priate key file location. First go to Session, click on your session under Saed Sessions, click Sae Finally, click Open to connect. Public Key Encryption (DONE) Now when you connect, PuTTY will log in automatically (yet securely.) For CTEC1767 Lab 6, this completes Part A of the lab. Take a screenshot of your PuTTY window showing this type of message. 10
Public Key Encryption -- Troubleshooting You may get an error message saying Serer refused our key you can still log on with your password. Public Key Encryption Troubleshooting (2) This can be caused by: 1. 1. An old (stale) public key in the authorized_keys file 2. 2. A corrupted authorized_keys file 3. 3. Spelling the authorized_keys filename incorrectly 4. 4. Wrong permissions on the authorized_keys file 5. 5. The Security-Enhanced Linux (selinux) software Public Key Encryption Troubleshooting (3a) Re-creating the authorized_keys file. First log on using your password: Public Key Encryption Troubleshooting (3b) Step 1a. Make a backup of the old authorized_keys file (if it exists; if not you will get an error message. Use the Tab key to help you complete filenames. cp.ssh/authorized_keys.ssh/authorized_keys.old Step 1b. Remoe the old authorized_keys file. rm -f.ssh/authorized_keys 11
Public Key Encryption Troubleshooting (3c) Step 2a. Open your existing priate key file, to select and copy the matching public key. Here, my priate key file was saed on the Windows Desktop. I can right click on the file, and then choose Edit with PuTTYgen to open it. Public Key Encryption Troubleshooting (3d) Step 2b. Create a new authorized_keys file and paste your public key. Pay attention to the correct spelling. Press Enter, then Control-D after you paste. cat >.ssh/authorized_keys ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEApuwpOh/0Ii2Q5xlibOoV2X++sfT4t1xB3jpmATMsfcQoh8cAj3YRFte7SpIX ZTdjkoAbnfLQ0FD+lSLjk/3PSr3FMxKEfwFD7Mfpeh8ylSqGqIWpn1oOjI5PMJdqKDrgtBGeK6bPItEKBQf2mL/S 937ftng3o8WkbcsL3VyCqn+AqAuP3/yksKq1g++l8d9nOVfw+NU3Rk8lTWUtNgTyyJgZisMyjNuHRzl6FuAoT4y BfZqV04PQsVBn0TklJCPgsPHZU/FhlaeHb4w4+14cuM9ZEnLWTQjQBtNaV+zWaVUElBbVhRDRzj5cxtx2e8Mg/ dokaumixpjqee1s33w== rsa-key-20180606 Step 3. Apply the correct filesystem permissions. chmod 644.ssh/authorized_keys Step 4. Control-D to log off/close PuTTY. Restart PuTTY, reload your session and try to connect again. Appendix Setting Up WinSCP to use your PuTTY keys WinSCP When you install WinSCP 5.13.1*, it may offer to import any existing PuTTY settings. WinSCP is actually built on top of the PuTTY code base. You can also configure WinSCP at any time. *As at 2018-05-09 12
WinSCP Installation WinSCP Installation (2) Like FileZilla, WinSCP is licensed under The GPL. Just accept the defaults. Howeer, PuTTY is licensed under the MIT licence, and is considered Open Source software (as opposed to Free Software; the two categories are often combined ) WinSCP Installation (3) WinSCP Installation (4) I prefer the Commander * Interface (the default) it is similar to FileZilla FTP Client. Click on Install. * https://en.wikipedia.org/wiki/total_commander 13
WinSCP Installation (5) WinSCP (Startup) The WinSCP installer will offer to import PuTTY sessions (which it finds in the Windows Registry) click Yes. Check off the one(s) that you want and click OK. Click on your PuTTY profile and then Login to connect. WinSCP (Connected) WinSCP Manual Setup If you need to Set up another Profile, It is similar To the FileZilla FTP Client s Site Manager. Your PC s files are here. Your files on the serer are here. Click on New Site 14
WinSCP Manual Setup (2) WinSCP Manual Setup (3) Enter the Host name and User name only Then click on Adanced... to set up your key If you change the port from 22 to 443, reset the File Protocol to SCP. From the Authentication category, click on the browse button to select your PuTTY priate key (.ppk) file WinSCP Manual Setup (4) WinSCP Login Click Sae to store the settings (the button changes name to Edit after you sae) Click Login to connect Like PuTTY, the first time you connect with WinSCP asks if you trust the computer that you are connecting to 15
WinSCP - DONE Like FileZilla FTP Client, your local files are shown on the left side, and the remote files are shown on the right. Simply drag from left-to-right/right-to-left to upload/download All transfers are encrypted using SSH 16