using_ssh_for_connections_transfer_to_from_sdf
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
using_ssh_for_connections_transfer_to_from_sdf [2021/03/14 01:50] – [connecting to SDF from a network] hc9 | using_ssh_for_connections_transfer_to_from_sdf [2024/09/04 17:38] (current) – cleaned up a bit peteyboy | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Using SSH for connections/ | ||
+ | |||
+ | ===== Overview ===== | ||
+ | |||
+ | This tutorial discusses some important points concerning use of SSH for encrypted traffic to and from SDF. Your first source for information are the manpages: '' | ||
+ | |||
+ | //Note: this text has been assembled from articles written by several users; therefore, layout and wording may vary, and topics can be referred at several places.// | ||
+ | |||
+ | SSH stands for Secure SHell, and is a replacement for telnet, to permit secure terminal connections. The system mainly consists of the following programs: | ||
+ | |||
+ | '' | ||
+ | |||
+ | This is the main program, used for direct terminal connections to a remote computer. In principle it is used like '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | This is a replacement for ftp or rcp, and permits secure copying of files to and from a remote computer. Its basic syntax is '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | This is a replacement for ftp, permitting listing of a remote file system and copying to and from it. It has more capabilities than scp, but needs a remote service running under ssh. In principle it is used like '' | ||
+ | |||
+ | On the client side, a lot of programs are available; you may be best off by using a search engine with the keywords '' | ||
+ | |||
+ | |||
+ | How to get to an ssh client depends on your OS: [[ssh client]]. Special topics below take advantage of a popular free tool for Windows called ' | ||
+ | |||
+ | ===== SDF issues ===== | ||
+ | |||
+ | Here we discuss some peculiarities concerning SDF and SSH. | ||
+ | |||
+ | === file and directory permissions === | ||
+ | |||
+ | [[using_ssh_for_connections_transfer_to_from_sdf# | ||
+ | |||
+ | To make sure you have the right permissions, | ||
+ | |||
+ | '' | ||
+ | |||
+ | You should look up '' | ||
+ | |||
+ | ====== special topics ====== | ||
+ | |||
+ | ===== How to enable Port Tunneling and Why ===== | ||
+ | |||
+ | === What is port tunneling good for === | ||
+ | |||
+ | Port tunneling is the ability to tunnel from your internet point for presence back to SDF servers and use the SDF servers like a [[wp> | ||
+ | |||
+ | === What tools are needed === | ||
+ | |||
+ | * A good SSH Client that allows tunneling ([[http:// | ||
+ | * Any software package that understands SOCKS 4 ([[http:// | ||
+ | * [[https:// | ||
+ | |||
+ | === How to set up PuTTY === | ||
+ | |||
+ | First you need to connect to a SSL enabled SDF server: otaku.freeshell.org on port 443. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Then you need to configure the port to tunnel on your local machine. Generally Socks proxies use port 1080 so that is a good port. Click on the Tunnels category and configure the tunnel as shown below. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Click on the " | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Then go back to session and name and save the session. Click connect and the tunnel should become active. | ||
+ | |||
+ | === How to use the Tunnel you just enabled === | ||
+ | |||
+ | I am now going to configure Trillian (A great multi IM chat program) to use the Tunnel. It should be obvious how to configure other applications from these screenshots. \\ First click on the " | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Click on " | ||
+ | |||
+ | ===== SSH Public Key Authentication ===== | ||
+ | |||
+ | These instructions attempt to explain the basic concepts of SSH Public Key Authentication, | ||
+ | |||
+ | //Note: Please make sure to have set the [[# | ||
+ | |||
+ | Logging in with SSH key authentication means that you do not have to use your SDF account password. Instead, you generate a ' | ||
+ | |||
+ | This may sound insecure or easily exploitable. In fact though, due to much research and theory, it can be very secure. Notice "can be" in that last sentence. The key files are taking the place of a password in proving to the server that you're really you. Just like you have to keep passwords secret, the strength of this method relies on you following certain guidelines. You will generate a pair of mathematically related keys: one public and the other private. **You should never give out your private key, nor should you make the file that contains it readable by any other user. This would be like storing your password in a world-readable file.** Only your *public* key will be listed on the server. Ensuring that your private key remains private is the most important of the guidelines that I mentioned. On to the instructions: | ||
+ | |||
+ | === Windows instructions: | ||
+ | |||
+ | You will need an SSH client and a key generator for Windows. These instructions are written for the popular programs PuTTY and PuTTYgen. Both are available at www.chiark.greenend.org.uk/ | ||
+ | |||
+ | Run PuTTYgen. At the bottom of the window, you can select which type of key you want to generate. You will need to pick between RSA and DSA encryption: go with RSA -- the relevant website is here: the.earth.li/ | ||
+ | |||
+ | Now press Generate and wave your mouse around to seed some randomness in the key generator. Viola, you have a key. | ||
+ | |||
+ | You can then add a passphrase to your key, and use just that one passphrase whenever you log in to an ssh server using your key. Alternately you can use no passphrase. Be aware though that if //you// don't have to use a password to login from your computer, then //neither would anyone else that sits down at your computer// or otherwise accesses your local account. | ||
+ | |||
+ | The key comment is for your personal convenience, | ||
+ | |||
+ | Next, you need to configure PuTTY to use this key. Fire up PuTTY and load your session or create a new one. Then in the Category list on the left, selecct Connection > SSH > Auth. Browse for your key and load it up. Also, you'll want to allow changes of username if your SDF account name is different from your local one. | ||
+ | |||
+ | You're almost done! Now you need to let the server know about your new key. After you do this, the ssh, scp and sftp programs will use the key files automatically. So (optionally, | ||
+ | |||
+ | - Copy the contents in the Key Generator window (" | ||
+ | - Log in as normal and run the following commands. | ||
+ | - '' | ||
+ | - '' | ||
+ | - '' | ||
+ | - Open the authorized_keys file you just created in a text editor. | ||
+ | - Paste the contents of that box in to the authorized_keys file. In PuTTY, right click copies and pastes. | ||
+ | - Save the authorized_keys file. | ||
+ | |||
+ | You should now be able to log in using SSH Key Authentication. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | I succeeded somewhat differently. In my trial, public key should be rather copied not from the saved public key, but from **Public key for pasting into OpenSSh authorized_keys file:** textbox in the PuTTYgen window. Note that we can also extract from existing PuTTYgen-type private keys (just load into it, and the public key should be there.). | ||
+ | |||
+ | === OpenSSH instructions: | ||
+ | |||
+ | You can get OpenSSH at www.openssh.com or through package installers like rpm or apt-get. There are versions for most major non-Windows operating systems (and even one for Cygwin.) Once you have the OpenSSH suite set up, the program you will need to run is '' | ||
+ | |||
+ | you@yourcomputer: | ||
+ | |||
+ | You can then add a passphrase to your key, and use this passphrase whenever you log in to an SSH-enabled server. Alternately you can use no passphrase. Be aware though that if //you// don't have to use a password to login from your user account, then //neither would anyone else that sits down at your computer// or otherwise accesses your local account. | ||
+ | |||
+ | You now have two new files in the ~/.ssh/ directory. These files are your public and private key and will be named id_rsa.pub and id_rsa respectively. The ssh, scp and sftp programs use these files automatically. To enable the server to recognize your key, follow these steps: | ||
+ | |||
+ | - Log in as normal and run the following commands. | ||
+ | - '' | ||
+ | - '' | ||
+ | - '' | ||
+ | - Open the authorized_keys file you just created in a text editor. | ||
+ | - Paste the contents of your id_dsa.pub file in to the authorized_keys file. | ||
+ | - Save the authorized_keys file. | ||
+ | |||
+ | You should now be able to log in using SSH Key Authentication. | ||
+ | |||
+ | ===== connecting to SDF from a network ===== | ||
+ | |||
+ | //... or configuring SSH clients to use a SOCKS proxy server// | ||
+ | |||
+ | Assuming that you are having trouble connecting to SDF from your college network you will probably have to configure a connection through a SOCKS proxy. This tutorial gives help on configuring various clients to use a SOCKS proxy. | ||
+ | |||
+ | You will need to know the following information from your system administrator... | ||
+ | |||
+ | * Proxy hostname i.e. '' | ||
+ | * SOCKS version (4 or 5) | ||
+ | * Port number to connect to (default is 1080) | ||
+ | * Your username and password | ||
+ | |||
+ | === SSH(C) – SSH Communications Security Corp === | ||
+ | |||
+ | This client is often supplied by universities to their students. | ||
+ | |||
+ | - Access the settings dialogue under "Edit -> Settings" | ||
+ | - Under the '' | ||
+ | - {{: | ||
+ | - Under the '' | ||
+ | - {{: | ||
+ | -Connect as normal! | ||
+ | |||
+ | === PuTTY === | ||
+ | |||
+ | A popular free SSH client. | ||
+ | |||
+ | - Select in the left window " | ||
+ | - {{: | ||
+ | - Enter in your details. Illustrated are those for TCD. | ||
+ | - Connect as normal! (You may want to save these details for future use) | ||
+ | |||
+ | === Commandline ssh client === | ||
+ | |||
+ | Those using MacOSX, Linux, SunOS or some BSD or other will be used to using the commandline ssh client to connect to SDF. Connecting via SOCKS is slightly more difficult and relies on an external program known as ' | ||
+ | |||
+ | All the details for using this program are documented on its webpage at http:// | ||
+ | |||
+ | Good luck! | ||
+ | |||
+ | Alternatively, | ||
+ | |||
+ | '' | ||
+ | |||
+ | Then, configure your browser to use the SOCKS proxy on " | ||
+ | |||
+ | {{: | ||
+ | |||
+ | For additional security and privacy, configure Firefox to do remote DNS lookups rather than the default local DNS lookups. In // | ||
+ | |||
+ | ---- | ||
+ | |||
+ | $Id: SSH-SDF.html, | ||