Putty paste from clipboard. Tips for working effectively with Putty. Connecting to a remote PuTTY computer

May 30, 2014 | Author: dd |

Of course, it's interesting when some knowledge is at the subcortex, at the level of instincts - yesterday at the forum they asked how to paste from the clipboard in the puTTY terminal client.

At first, the question even baffled, because. if abstracted from work, then you don’t even remember. It seems that you can insert into puTTY by right-clicking the mouse, but you can’t say for sure, because this is already at the level of reflexes. So I had to climb to check, at the same time, I fixed something on the server. Moreover, the person began to cry that he could not find any information on subjects in tyrnets. But I somehow know that in puTTY all copying and pasting is done through the mouse, and I was not born with this knowledge:

paste into puTTY from the clipboard - by clicking on the right mouse button (as an option Shift + Insert);
copy to puTTY - select the text and left-click.

Only when pasting text, one must take into account the fact that if the next line is accidentally copied to the clipboard, the transition will follow the ENTER input and, as a result, the command will be launched for execution.

So yesterday, trying again, I had to constantly kill them from the processes.

Clipboard operations in puTTY, 5.3 out of 10 based on 9 ratings

PuTTY– software client for remote connection and configuration of Linux servers, Telnet terminals, network routers. Using PuTTY you can connect via SSH, Telnet, Rlogin network protocols to end hosts; configure devices via serial Com-port.

PuTTY how to use or connect via PuTTY SSH

We open the PuTTY program and in the “Session” category we specify the host name or IP address of the server, by default we use port 22. We write the session name and press the “Save” button, this is done so as not to re-enter the IP address each time the next time you connect to the server.

Before saving the connection, you need to click on the “Change” button in the “Windows” - “Appearance” category and select “Cyrillic” from the character set, then check the encoding in “Translation”, which should be set to UTF-8 - these settings will ensure correct display Cyrillic characters. Connection is set!

Note: To successfully connect to a server, terminal or network router, an SSH server must be configured on the side of the terminal equipment, port 22 must be open, and Firewall / Windows Firewall must be disabled on the local computer from which the connection is made.

We try to connect to the SLES 12 SP1 x64 server by clicking on the "Open" button, as shown in the first figure. During the initial connection, a warning window will be displayed that the Putty program will write down the remote server encryption key, confirm by pressing the "YES" button.

A terminal window opens, where you need to enter your username and password to enter the system, after each entry, press the "Enter" key. When entering a password, characters are not displayed. A successful connection to the SSH server is due to the last login and the appearance of the hostname.

To control the system, you must use Unix commands, Cisco and others. For more convenient management of the Linux system, I recommend using MC - Midnight Commander (a file manager with a text interface).

An example of the output of the entered ls -ls command (shows a detailed output of the list of files, permissions, owner group, sizes of each file, date, etc.):

PuTTY hotkeys

The main and most important copy paste, to copy text from anywhere to the clipboard, you must press the Ctrl-C key combination and paste it into the PuTTY window using the Shift-Insert hotkeys or by pressing the right mouse button, thereby the text will be inserted into the console. If you need to copy/paste text in the PuTTY window itself, then simply select the text in the window and paste in the same way as above.

Ctrl+A - go to the beginning of the line

Ctrl+C - end the current command

Ctrl+D - termination of the session ("exit" command)

Ctrl + L - shift the screen, everything that was previously entered will move to the very top

Ctrl + P - display previously entered commands (pressing the Up / Down arrows)

Ctrl+U - delete line

Ctrl+W - delete one word on the current line

Ctrl+Z - stop the current command

Today, SSH is the most common protocol that allows you to quickly and securely connect to your servers for their configuration and other administrative tasks. In this article, we will look at the popular PuTTY SSH client that allows you to manage servers based on Linux / FreeBSD operating systems.

We will not tell you how to perform basic actions with the program in this article. And I suggest that you familiarize yourself with the settings and functions that will help you work with PuTTY more efficiently.

Increasing the number of terminal lines

Often, as a result of some actions, a large amount of information is displayed in the console, and you need to scroll through it. However, the default settings limit output to the last two hundred lines. To change this parameter, open the settings window, go to the Window category and change the Lines of scrollback parameter to a value that suits you, for example, 5000.

Useful hotkeys

Copying and pasting text

To copy text from the PuTTY console, you just need to select the text - it will automatically be copied to the clipboard. To paste text into the console, use the Shift + Insert key combination, or you can simply right-click in the console.

Editing an input command

Ctrl+A - move the cursor to the beginning of the input line
Ctrl+E - move the cursor to the end of the input line
Alt + F - move the cursor to the next word in the input line
Alt + B - move the cursor to the previous word in the input line

Ctrl+U - delete all characters preceding the cursor; convenient to use to completely delete the printed command
Alt+BackSpace, Ctrl+W - delete the word preceding the cursor

Scrolling text

Of course, the most natural is scrolling with the mouse wheel. But scrolling with hotkeys is faster in many cases. If you want to increase the efficiency of your work, try it.

Shift+PageUp - scroll text up
Shift+PageDown - scroll text down
Ctrl+PageUp - Scroll up text line by line
Ctrl+PageDown - line-by-line text scroll down

Additionally

Ctrl+C - interrupt the execution of the current command
Ctrl+L - clear screen

Transferring PuTTY sessions to another computer

Imagine a situation where you need to transfer sessions created in PuTTY to another computer. The easiest way is to transfer the corresponding registry branch. To do this, run the following command at the Windows command prompt:

C:>regedit /e "%userprofile%\desktop\PuTTY.reg" HKEY_CURRENT_USER\Software\Simontatham

After that, the PuTTY.reg file will appear on the desktop, which must be transferred to another computer, run and agree with the import of the registry branch.

Authorization without using a password

If you are used to using a login-password combination to access the server, then I can offer you an easier and safer way to log in to your server. And if you have several servers, and the passwords are different everywhere, then this option will greatly simplify your life.

PuTTY supports public key authentication. You can generate a pair of keys: public and private. You place the public key on all servers where you want to authenticate using this method, and keep the private key in a safe place.

So, let's start setting up this authorization method.

Let's run the PuTTYgen program, which is installed with PuTTY.

In the next window, select the SSH-2 RSA key type. And specify the value 2048 in the Numbers of bits in a generated key field.

Then click Generate and move the cursor within the window until the progress bar is full.

Next, click Save public key and save the public key under the name id_rsa.pub. Click Save private key and save the private key under the name mykey.ppk, agreeing to save the key without using a password.

Now you need to copy the public key to the server. This can be done, for example, using the PSFTP utility, which is also installed with PuTTY.

Open the program and enter:

psftp> open youserver.ru
psftp> put id_rsa.pub /tmp/id_rsa.pub

ssh-keygen -i -f /tmp/id_rsa.pub >> /root/.ssh/authorized_keys

And finally, we launch Pageant.

After that, an icon will appear in the tray. Right-click on it and select AddKey. In the window that appears, add the private key mykey.ppk. That's all, from now on, when entering the server, the password will not be requested.

Other programs for working with SSH

If you have several servers and want to work with them more efficiently, then try a convenient "wrapper" for PuTTY - PuTTY Connection Manager. You can download it from here.

Bitvise SSH Client

This product is similar to PuTTY and its use should not cause problems. The main advantage of Bitvise SSH Client is the presence of a very convenient two-pane SFTP file manager. The program is free and available for download from the official website.

SecureCRT

Paid alternative for those willing to part with $99. The client has more functionality than PuTTY. Among them, for example, the ability to create keys in the application itself, remember passwords, auto-connect to a remote server.

Each time enter the password blindly to enter the server ( especially if it is "good", that is, long and not memorable) is extremely tedious. Therefore, the standard saving of a server connection session in PuTTY leaves much to be desired. And so you want to go to the server in one, maximum two clicks! This begs the question: How to run PuTTY with a password? And what is strange, there is an answer to this question. Even two! =)

Security Warning!

The data storage methods (login and password) described in this article are not safe!

If an unlimited circle of people has access to your computer, then it is better to refrain from using them, since the data will be stored in an open (unencrypted form)! Data will be transmitted over the network using the protocol selected in PuTTY, so there is only one threat: data can only be stolen from your computer while you are away for coffee and a croissant. ;)

Primary settings

In order to start PuTTY with a password, you must first save session settings in it. With these settings, further login to the remote server will be carried out.

Option one. Launching PuTTY with a password, running bat file with user data

For starters of course create a bat file. It’s probably worth naming the batch file somehow meaningfully and placing it in the place where it will always be at hand when you need to go to the server. Thereafter write in it the following information:

Cd %ProgramFiles%\Putty\ start putty.exe -load SERVER_NAME -l USER_NAME -pw PASSWORD

To make it clear what these two lines mean:

  • cd - command to move through directories (then is an absolute path, so the batch file will be launched from any place where it will be, even from a flash drive)
  • %ProgramFiles% is a Windows operating system constant that represents the absolute path to the Program Files folder. This folder has a space in its name. That is why this constant is used.
  • %ProgramFiles%\Putty\ - absolute path to the directory (standard when installing PuTTY), where the putty.exe program is located. Where they installed, there it lies. If to another place, this path must be changed to the one on your computer
  • start - Windows command to execute the file. If you do not specify it, then two windows will open: one of the Windows console, the second is the PuTTY window itself with an open session with the server. Why would we leave the Windows console window open?
  • putty.exe - the actual file of the PuTTY program, which we run with the parameters:
    • -load - open the server specified in the SERVER_NAME parameter
    • -l - precedes the input of the username specified in the USER_NAME parameter

They entered everything, substituted their data, saved the changes in the bat-file. Now, by double-clicking, we launch the batch file and immediately get to the server under the user whose data is saved. Comfortable! =) But not safe (as I wrote above).

Option two. Launching PuTTY with a password, indicated in the label of the program putty.exe

As the name of this option implies, the first step is to create a program shortcut putty.exe . It makes sense to name the label in such a way to understand which session data is stored in it, so as not to get confused. Since the paths to the program in the shortcut are specified in absolute form, then label can be moved to the place where it will always be at hand and not be evident to those who want to steal the data stored in it ( login and password to the server).

After the shortcut is created, open its properties:

In the window that opens, on the tab " Label» into line « An object»Add data about our connection to the server in the form:

"C:\Program Files\PuTTY\putty.exe" [email protected] _NAME -pw PASSWORD

  • "C:\Program Files\PuTTY\putty.exe" - the path to the putty.exe program, written in quotes
  • USER_NAME - the username that we previously entered manually every time we entered the server
  • @ - icon like this =)
  • SERVER_NAME is the name of the server stored in the PuTTY sessions we are connecting to
  • -pw - precedes the user's password, which is specified in the PASSWORD parameter
  • PASSWORD - user password for logging into the remote server

And press the button " OK».

For security purposes, Wondows may ask you to confirm a change to the shortcut settings. Here you just have to agree. =)

That's all in general.

Conclusion

If the PuTTY sessions have saved data that matches the data saved in the shortcut and / or bat file, then when you start the batch file or double-click on the shortcut, the session will open immediately with the logged in user, which is extremely convenient, but not very safe, because. to. All data is stored in clear text.

Article content:

Linux has a wonderful ssh client, Putty, which is used by a huge number of administrators when it is necessary to log into the server, but when using it, you may encounter difficulties when performing operations with the clipboard. The standard Windows key combinations Ctrl + C and Ctrl + V do not work here, and the usual menu with the "copy" and "paste" items is missing. This article will discuss the Linux Mint + Putty bundle, because. It was on this OS that this information was checked, but most likely the information will be relevant for Ubuntu similar systems.

How to copy text

In order to copy the desired text from the Putty console window, simply select it with the left mouse button. Those. just hold down the left mouse button, select the desired fragment, release the left button and that's it, it has already been copied to the clipboard.

How to insert text

Option 1 (using the mouse)

If you use a mouse that has a middle button (or a wheel that can be pressed), then you can paste the copied text in the right place (browser, text editor, local console, etc.) by simply pressing this very middle button (wheel ).

Option 2 (using the keyboard)

If you do not have such a mouse at your disposal, or if it is more convenient for you to use the so-called hot keys, then you can insert the selected text using the following key combination:
Shift+Insert

But this key combination will help you paste the copied text only in the Putty window itself. In order to paste the copied text to any other place, you must use the middle mouse button, as described above.

Option 3 (using touchpad)

What if you are using a laptop with a touchpad that only has two physical buttons? The answer is simple, you need to emulate pressing the middle mouse button on the touchpad. On my laptop, this is done as follows: we touch the surface of the touchpad with three fingers at the same time (I saw an indication on the Internet that two are enough, but in my case it does not work) and without removing my fingers from the surface, press the left button of the touchpad. This option, like the first one, is suitable for pasting text from the buffer not only into the Putty console, but also to any other place.