Putty paste from the clipboard. Putty how to use - putty ssh, hotkeys. Increasing the number of terminal lines

💖 Do you like it? Share the link with your friends

Blindly enter your password each time to log into the server ( especially if it is “good”, that is, long and not memorable) is extremely tiring. Therefore, the standard saving of a connection session with a server in PuTTY leaves much to be desired. And I really want to log into the server in one, maximum two clicks! This raises the question: “ How to run PuTTY with password?“And what’s strange is that there is an answer to this question. Even two! =)

Safety Warning!

The methods of storing data (login and password) outlined in this article are not secure!

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

Primary settings

In order to run 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. Launch PuTTY with a password, running the bat file with user data

To begin with, of course create a bat file. It’s probably worth naming the body file something meaningful and placing it in a place where it will always be at hand when you need to log into the server. After that write it in 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, let me explain:

  • cd - command to navigate through directories (then is an absolute path, so the batch file will be launched from any place where it is located, even from a flash drive)
  • %ProgramFiles% is a Windows operating system constant that denotes the absolute path to the Program Files folder. There is a space in the name of this folder. 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 it was installed, it lies there. If to another location, this path needs to be changed to the one on your computer
  • start - Windows team to execute the file. If you do not specify it, two windows will open: one Windows console, the second PuTTY window itself with open session with the server. Why should we leave open window Windows console?
  • putty.exe is the actual PuTTY program file, which we launch with the following parameters:
    • -load - open the server specified in the SERVER_NAME parameter
    • -l - precedes the username specified in the USER_NAME parameter

You entered everything, entered your data, and saved the changes in the bat file. Now, double-click to launch the batch file and immediately go to the server under the user whose data is saved. Comfortable! =) But not safe (as I wrote above).

Option two. Launch PuTTY with a password, specified in the program shortcut putty.exe

As is clear from the name of this option, the first thing you need to do is create a program shortcut putty.exe. It makes sense to name the shortcut so that you can understand which session data is stored in it, so as not to get confused. Since the paths to the program in the shortcut are indicated in absolute form, then the shortcut can be moved to a place where it will always be at hand and not noticeable to those who want to steal the data stored in it ( server login and password).

After the shortcut is created, open its properties:

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

"C:\Program Files\PuTTY\putty.exe" USER_NAME@SERVER_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 each time when logging into the server
  • @ - this is the icon =)
  • SERVER_NAME - the name of the server saved in PuTTY sessions with which we are establishing a connection
  • -pw - precedes the user's password, which is specified in the PASSWORD parameter
  • PASSWORD - user password to log into the remote server

And press the button " OK».

For security purposes, Windows may ask you to confirm changes in the shortcut parameters. Here you just have to agree. =)

That's basically all.

Conclusion

If there is saved data in PuTTY sessions that matches the data saved in the shortcut and/or bat file, then when you run the batch file or double-click on the shortcut, a 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 format.

Good afternoon, here is a small reminder for yourself describing how to copy paste in PuTTY. The SS H protocol was developed as a secure, encrypted replacement for the RSH protocol. RSH is used for remote access shell to the UNIX (or UNIX-like) system and was once popular among system administrators before network security became the ongoing issue it is now. Now, thanks to SSH, you can gain security using an encrypted protocol known for its versatility and security. While OpenSSH is probably the most used SSH implementation in the world, PuTTY is the most commonly used SSH client for the MS Windows platform.

Key Features of PuTTY

Like OpenSSH, PuTTY is a very versatile tool for remotely accessing another computer. It is probably used more often by people who need secure remote shell access on a UNIX or Linux system than for any other purpose, although this is only one of its many uses. PuTTY is more than just an SSH client. It supports all the following protocols:

  • raw: The raw protocol is typically used for network debugging.
  • rlogin: This is an unencrypted UNIX remote login protocol that uses port 513 by default.
  • serial: The serial option is used to connect to a serial line. The most common purpose for this is to establish a serial connection between computers instead of Ethernet or other network connection.
  • SSH: As noted, SSH is an encrypted secure remote login protocol that uses port 22 by default.
  • Telnet: is an unencrypted remote access protocol. It typically uses port 23 and is available on many systems other than UNIX. Like rlogin, Telnet has declined in popularity due to privacy concerns.
  • In addition to the five protocols supported by PuTTY, it also supports features such as saved session configurations, session logging, locale (language) settings, and proxy sessions.

Importance of SSH on Windows

Of course, there are a number of reasons to use a tool like PuTTY. But the most common targets are related to the SSH protocol. It is a terrible idea to connect to a web host over an unencrypted connection to manage the web hosting and transfer files. Using an unencrypted login is good way make yours account web hosting “owned” by an attacker. Using a secure, encrypted protocol such as SSH for such purposes is a much better option.

SSH over PuTTY offers a fast and easy way to securely access a UNIX shell environment from a Windows system. This is convenient not only because of the obvious need for some people to work with Windows and UNIX/Linux systems, but also for people who are forced to use Windows and want access to the capabilities of the UNIX shell. As with OpenSSH, PuTTY can be used as a secure web proxy. PuTTY can be used to secure TortoiseSVN connections to the Subversion server.

IN operating systems The Linux family widely uses the SSH protocol for remote access between machines. Its popularity is due to the simplicity, reliability and security of the connection. Connecting via SSH to remote computer, you get the opportunity to execute any terminal commands on it, as if you were working on your computer, even autocompletion and other auxiliary features work.

Sometimes there is a need to connect to a remote Linux computer from Windows, but by default, there is no utility designed for this. Eat third party program, it's called PuTTY and you can install it separately. In this article we will look at how to use PuTTY to connect to Linux systems, and we’ll also talk about how PuTTY is configured for easy use.

First you need to download the program installer. To do this, open the official website and click "You can download PuTTY here":

Then select the installer for your architecture, x86 or x64, and download it.

In the first step, click "Next":

The installation folder can be left as default:

Components too:

Wait for the installation to complete:

Uncheck "View README" and press "Finish":

Now let's move on to how work is done in PuTTY.

How to use PuTTY

1. Program interface

Immediately after launching the program from the start menu, you will see GUI its settings. After connecting, you will only see the terminal, but you can configure the program through a convenient interface.

Let's look at what these or those program tabs are responsible for, so that you can know what and where to look. We have four tabs:

  • Session- is responsible for connecting to a remote server, here we enter connection parameters, port, address, and we can also save all putty settings so as not to configure it again each time.
  • Terminal- allows you to enable or disable terminal capabilities;
  • Window- setting appearance windows, color, font, encoding;
  • Connection- setting connection parameters, encryption algorithm, compression, authentication keys, X11 and other parameters.

Each tab has several subsections, but we will not touch them now, but will go straight to practice and see how to connect putty to a remote node.

2. Connect to a remote computer PuTTY

To connect to a remote computer via SSH, go to the tab "Session", here in the field "Host Name" you need to enter the IP address or host name of the computer you want to connect to in the port field - you need to specify the port on which the SSH server is running, port 22 is used by default:

Then you will need to enter your username and password. It is important to note that you will not be able to copy your login or password; you only need to enter it manually:

3. Saving a PuTTY session

In order not to enter the ip and port every time, you can save this data as a session, to do this, write a new name in the field "Saved Sessions" and then click the button "Save":

You will now be able to load your saved session by clicking the button "Load".

After the putty setup is completed and all parameters are set correctly, you can save the settings and not enter them several times.

4. Default username

You don't have to enter your username every time; to do this, go to the tab "Connection", then "Data" and in the field "Auto-login Username" enter the user name, for example, root:

Now the putty connection will be performed on behalf of this user.

5. Authorization using ssh key in PuTTY

In order not to enter a password every time, you can set up authorization using a key. In Linux, this feature is used very widely because it is convenient. The first step is to create a key. To do this, run the PuTTYgen utility and set the switch to position "SSH-2 RSA" click "Generate":

The key must be SSH-2 RSA, if not in the main window, select from the menu "Key". Move your mouse to create enough entropy:

The key is ready, then using the buttons "Save Public Key" And "Save Private Key" save both keys.

Here you need to click the button "Browse" and add the recently saved private key:

Next, return to the tab "Session", select our save and click “Save” to save the settings. All that remains is to send our public key to the server. To do this, log in to it using a password and paste the public key at the end of the /root/.ssh/authorized_keys file.

The key can be taken directly from the PuTTYgen window "Public key for pasting" or from the public key file:

That's it, now you can log out and log in again. This time the connection via ssh putty will be performed using our key. Don't forget to save your session settings so you don't have to select a key every time. Now you know how to use putty, let's look at transferring files.

5. Transferring files via scp to PuTTY

Not everyone knows, but PuTTY allows you to transfer files via ssh just like Linux does using the scp utility. Press Win+R, then type cmd to launch the command prompt.

The pcsp utility syntax is as follows:

pscp options file_path Username@host: /path/to/file/on/remote/host

For example, we can send a file from the current folder to the user's /root/ folder:

pscp test.txt [email protected]:/root/

You can use the -P option to set the remote port:

pscp -P 2250 test.txt [email protected]:/root/

And the load option allows you to load saved PuTTY session settings:

pscp -load losst-2 test.txt [email protected]:/root/

Now you know how to use putty to transfer files.

conclusions

In this article, we looked at how to use PuTTY to solve Linux administration problems on Windows. Sometimes situations happen that you can’t do anything without ssh in Windows, then this utility will be simply irreplaceable.

Article content:

Linux has a wonderful ssh client called Putty, which is used by a huge number of administrators when they need to log into the server, but when using it, you may encounter difficulties when performing operations with the clipboard. Standard for Windows combinations The Ctrl+C and Ctrl+V keys do not work here, and the usual menu with the “copy” and “paste” items is missing. This article will discuss the connection Linux Mint+ Putty, because exactly on this OS this information and was checked, but most likely the information will be relevant for Ubuntu-like 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 required fragment, release the left button and that’s it, it’s already 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 you can press), then paste the copied text into the desired place (browser, text editor, local console, etc.) can be done simply by pressing this very middle button (wheel).

Option 2 (using the keyboard)

If you do not have such a mouse at your disposal or 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 only help you paste the copied text in the Putty window itself. In order to paste copied text to any other place, you must use the middle mouse button, as described above.

Option 3 (using touchpad)

What should you do 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 touchpad surface with three fingers at the same time (on the Internet I saw an indication that two are enough, but in my case it doesn’t work) and without removing our fingers from the surface, press the left button of the touchpad. This option, like the first, is suitable for pasting text from the buffer not only into the Putty console, but also into any other place.



tell friends