Let’s establish this key as one that you can use to log in to your CS Linux account. Most people use much longer passphrases than a typical password, but generally place less emphasis on odd character substitutions that make the phrase harder to type. Even though the command prompt says it’s optional, you don’t want to have an unprotected private key around. This is used to protect your private key in case someone gains access to the machine/account where you have it stored. Do keep it in your ~/.ssh directory, however. (I keep different key pairs for different client machines and name them accordingly, e.g., “officePC”, “homePC”, etc.). You can change the name of the generated files if you like. To generate a key pair, give the commands (on your client machine): mkdir ~/.ssh # if you don't already have this directory Also, you can generate keys from within Eclipse ( Window $\Rightarrow$ Preferences $\Rightarrow$ General $\Rightarrow$ Network Connections $\Rightarrow$ SSH2 $\Rightarrow$ Key Management, but the key length is limited to 1024 bits, which is considered a bit low these days. : Another possibility is Pageant, part of the PuTTY ssh suite for Windows. On a Windows CygWin system, you can get it as part of the openssh package. Most Linux systems will have this already installed. The ssh-keygen program is most commonly used to generate public/private key pairs. Once activated, the private key can be kept active through a work session, allowing you to repeatedly log in to clients that have your public key. That physical security is coupled with a lengthy passphrase needed to activate the private key. Often these client machines are ones you have a certain amount of physical control over - a home computer or a laptop that you own. You keep the private key on client machines that you log in from. You can distribute the public key to a variety of server systems that you like to log in to. Based on one-way cryptography, an ssh key has two parts: a public key and a private key. Ssh keys provide a way of identifying yourself that is generally more secure than simple passwords. For example, all of the techniques covered in CS252 for connecting via X Windows have actually relied upon an ssh tunnel to carry the X or NX protocol messages between the two machines. This includes protocols that normally are limited to local network connections or that, for other reasons, have trouble getting through firewalls and routers. The ssh protocol can act as a “tunnel” for other common network protocols (e.g., email). Ssh servers also, by default, provide file copying services via scp and sftp. The “default” is to issue the command to open a login shell, but you can issue any command you want. Ssh is useful for issuing all sorts of commands to a remote machine. Ssh -l yourCSLoginName atria.cs.odu.edu ls -l Now give the same command, but append a command string to the end: Issue a few commands to verify that everything is familiar, and then log out of the remote machine. You can also combine it with the machine name, separated by an yourCSLoginName opens up a familiar text-mode command session on the remote machine. You can omit the “ -l yourCSLoginName” if your current terminal session is under a user name identical to your CS Dept login name.Try opening a remote session on your server machine by issuing the following command on your client machine: Let’s start with just the basics of using ssh from the command line. I will assume in the rest of this document that you are using atria as your server. If you choose to use sirius.cs.odu.edu for your client machine, then use atria.cs.odu.edu for your server, or vice versa. This could be one of the CS Dept Linux servers, or from a terminal session on your own PC if it runs Linux, OS/X, or CygWin.Ī server machine, which will be one of the CS Dept Linux servers. You will be working withĪ client machine, at which you can issue ssh commands. We’re going to start by working with ssh from a command line. You should already be familiar with ssh even if you are used to invoking it through PuTTY. SSH keys are a convenience for interating with our Dept Linux servers and a necessity for the Dept Gitlab and other network services.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |