How to Use PuTTY (SSH Terminal)
SSH, or Secure Shell, is a secure protocol for connecting to a remote server. To establish an SSH connection, you will need an SSH client app like PuTTY.
In this guide, you will learn how to use PuTTY SSH terminal to connect to your hosting account or to a virtual private server. That way, you can access and manage your remote machine by executing various commands.
How to Manage Your Files via SSH – Video Tutorial
This advanced method of managing your files will unlock even more possibilities for you! Watch to find out more.

Linux
Most people use the preinstalled OpenSSH on Linux, however, PuTTY on Linux is used more for debugging, connecting to serial ports, and to raw sockets.
On Debian, use the following command:
Followed by the tools installation command:
MacOS
Like Linux, the macOS comes with a command-line SSH client already installed. But to download PuTTY, open the terminal window and use the commands below.
To install PuTTY for mac:
Requirements For Set Up
Next, you will need a bit of information before you can begin using PuTTY. You will need:
- Server IP Address
- SSH username
- SSH password
If you are Hostinger user, there are two ways to find this information, depending on your hosting plan:
- Shared web hosting — go to the SSH Access menu under the Advanced category. Here you will see all the login details that you need. If you forgot your password, easily reset it via the FTP Accounts menu.

- VPS plan — the credentials are located in the Server tab of hPanel, under SSH Details. In case you don’t know what your password is, scroll down to the Root Password section, and create a new one.

How to Connect PuTTY
- Launch the PuTTY SSH client, then enter your server’s SSH IP and SSH Port. Click the Open button to proceed.

- A login as: message will pop-up and asks you to enter your SSH username. For VPS users, this is usually root. However, for shared hosting users, you will need to enter a predefined username like u721233450. After entering your username, press Enter.
- Type your SSH password and press Enter again. For security reasons, the screen won’t show the password but will register what you type.

Congratulations! You have successfully connected to your account using the PuTTY SSH client. You can list all available SSH commands by executing help via the terminal.
How to Use PuTTYgen
PuTTYgen is a tool that creates public and private key pairs. PuTTY stores these key authentications in its .ppk format files. With Windows, you will use the PuTTYgen.exe graphical tool, while with Linux you will use the command line.
To begin, locate PuTTY and open PuTTYgen.
To create a new key pair, click the Generate button near the bottom and begin to move your mouse around within the window. Continue moving your mouse until the green progress bar is full.


After it is complete, your public key will appear in the window.
It is recommended to use a passphrase as well as saving your private key.
Install Public Key on Server
To grant access to an account, you will need to add the new public key to the file named
First, install the public key. Then, log into your server and locate the authorized_keys file. Edit the file and insert the new public key into the file. Save the file and test to see if the login works.
Conclusion
We hope this article helps you to use the PuTTY client to connect to your hosting account. If you want to learn more about SSH, we have several articles that can help you out:
Feel free to comment if you have any questions.
Linas started as a customer success agent and is now a full-stack web developer and Technical Team Lead at Hostinger. He is passionate about presenting people with top-notch technical solutions, but as much as he enjoys coding, he secretly dreams of becoming a rock star.
SSH для новичков

Программистов, сисадминов, devops’ов, тестировщиков часто объединяет использование некоторых общих технологий. Например, возможность иметь удалённый доступ к серверу пригодилось бы любому из указанной выше анекдотичной компании. Поэтому в этой статье мы рассмотрим основы работы с протоколом SSH на базовом уровня (без генерации ключей, подписей, мам, пап и кредитов). «Продвинутое» использование посмотрим уже отдельно, в следующий раз. Материал подготовил Макс, автор YouTube-канала PyLounge. Поехали!
Введение
SSH (Secure SHell — защищенная оболочка) — сетевой протокол прикладного уровня, предназначенный для безопасного удаленного доступа к различным системам (Linux, Windows, Mac).
Данный протокол шифрует всю передаваемую информацию по сети. По умолчанию, используется 22-й порт. В основном он нужен для удаленного управления данными пользователя на сервере, запуска служебных команд, работы в консольном режиме с базами данных.
Эта служба была создана в качестве замены не зашифрованному Telnet и использует криптографические техники, чтобы обеспечить, что всё сообщение между сервером и пользователем было зашифровано.
Чтобы установить SSH-соединение, необходимы два компонента: SSH-сервер и SSH-клиент. Сервер прослушивает определенный порт (по умолчанию это порт 22) и при успешной аутентификации дает доступ пользователю. Все команды, которые используются на SSH-клиенте, отправляются через защищенный канал связи на SSH-сервер, на котором они выполняются и откуда отправляют результат работы обратно клиенту.

SSH-сервер
Устанавливается на управляемой операционной системе и принимает входящие подключения от клиентских машин, проверяя соединение одним из способов:
по IP-адресу клиента, что не слишком безопасно из-за риска подмены;
по публичному ключу клиента и имени пользователя. Нужно создать приватный (закрытый) и публичный (открытый) ключ. Зашифровав информацию одним ключом, можно расшифровать ее только другим;
по паролю клиента, который передается в зашифрованном виде. Это один из наиболее распространенных вариантов. Вводить его нужно при каждом подключении.
Платные и бесплатные SSH-серверы есть для всех распространенных ОС:
Linux — dropbear, lsh-server, openssh-server;
Windows — freeSSHd, copssh, WinSSHD, OpenSSH и т. д.
SSH-клиент
Используется для входа на удаленный сервер и выполнения команд. Через клиент выполняется управление удаленным компьютером.
SSH-клиенты разработаны для всех ОС. Имеют платные и бесплатные версии:
Linux/BSD — openssh-client, putty, ssh, Vinagre;
Windows — PuTTY, SecureCRT, ShellGuard;
Встроенный SSH-клиент Windows, основанный на OpenSSH, предустановлен в ОС, начиная с Windows 10 1809.
Установка OpenSSH на Ubuntu
Установка с помощью менеджера пакетов apt-get:
Проверка SELinux
Security Enhanced Linux, или SELinux – это усовершенствованный механизм контроля доступа, встроенный в большинство современных дистрибутивов Linux. Первоначально он был разработан Агентством национальной безопасности США для защиты компьютерных систем от вторжения злоумышленников и взлома. SELinux также может помешать работе с ssh. Поэтому необходимо убедиться, что он отключен, либо отключить его.
Устанавливаем доп. инструменты для работы с сетью и настройками безопасности:
Проверяем статус SELinux. Состояние должно быть disable .
Подключение к виртуальной машине с типом подключения NAT
Если виртуальная машина использует тип сетевого подключения NAT, то первоначально необходимо настроить проброс портов. Пробросим порт хоста 2222 (или любой свободный) на гостевой порт виртуальной машины номер 22 (порт ssh по умолчанию).

После этого мы можем подключиться из Windows к нашей виртуальной машине.
Подключение по ssh через PuTTY
Т.к. в качестве сетевого подключения у виртуальной машины используется NAT, при подключении мы будем указывать петлевой адрес localhost (127.0.0.1) c портом, на который был назначен проброс.

После этого вводим имя пользователя (пользователь должен существовать в linux. ) и пароль от этого пользователя.
Подключение по ssh через Командную строку Windows (cmd)
Запускаем командную строку сочетанием клавиш Win + R . В открывшемся окне указываем cmd. Нажимаем OK.

В общем видео подключение по ssh имеет вид:
Если для подключения используется стандартный порт ssh — 22, то порт можно не указывать.
В открывшемся окне вводим команду:
Вводим пароль пользователя. Всё. Вы великолепны!
Подключение к виртуальной машине с типом подключение Сетевой мост
С типом подключения Сетевой мост необходимо выдать статический ip для Linux системы. Дальнейшее подключение будет уже по этому, выданному ip, а не через localhost.

Установка статического ip
Начиная с выпуска Ubuntu 17.10 NetPlan теперь это инструмент настройки сети по умолчанию для управления настройками сети, заменяющий файл конфигурации /etc/network/interfaces , который использовался в предыдущих версиях.
Файлы конфигурации для Netplan находятся в каталоге /etc/netplan и написаны на языке YAML. В этом каталоге вы найдете файлы конфигурации YAML.
Откроем конфигурационный файл:
Отредактируем конфигурационный файл:
ethernets — указывает на проводное Ethernet подключение;
enp0s3 — имя сетевого интерфейса (можно узнать командой ifconfig);
dhcp4 — автоматическая выдача ipv4-адреса с помощью службы dhcp (для ipv6 указывать dhcp6);
addresses — ip-адрес и маска сети, которые назначаются компьютеру;
gateway4 — шлюз по умолчанию;
nameservers — список dns-серверов.
Посмотреть настройки можно с хостовой машины на Windows с помощью команды ipconfig /all.
Чтобы применить изменения и перезагрузить сеть, вводим команду:
Подключение по ssh
Запускаем командную строку сочетанием клавиш Win + R . В открывшемся окне указываем cmd. Нажимаем OK.
В открывшемся окне вводим команду:
Вводим пароль пользователя. Всё. Вы великолепны (2)!
Заключение
Несмотря на высокую защиту протокола, использование стандартного порта значительно повышает риск взлома сервера. Например, это можно сделать при помощи brute-force (атака полным перебором). Порт 22 — открытый, поэтому злоумышленнику нужно только подобрать логин и пароль к серверу. Это сложно, но возможно. Чтобы максимально ограничить доступ к серверу для злоумышленников (настроить брандмауэр, iptables), можно сменить SSH-порты.
Как подключиться по SSH из Windows 10
Для настройки и управления удаленными серверами на базе Linux обычно используется протокол SSH. С помощью SSH на удаленный компьютер можно передавать данные и команды, которые будут выполняться так как бы они выполнялись на локальной машине.
В этой инструкции мы рассмотрим процесс подключения к SSH из Windows 10. Первый способ будет актуален для Windows 10 версии 1809 и выше, а второй можно использовать как на Windows 10, так и на Windows 7.
Подключение по SSH с помощью OpenSSH
Раньше для подключения к Linux серверу по SSH из Windows компьютера требовалась установка программы PuTTy или какого-то другого SSH-клиента. Но, в операционной системе Windows 10 (начиная с версии 1809 ) доступен клиент OpenSSH, с помощью которого можно подключаться к Linux серверам по SSH. Это позволяет работать с терминалом Linux прямо из командной строки Windows 10, при этом не требуется установка никаких сторонних программ.
Перед тем как использовать данный способ подключения необходимо проверить версию Windows 10. Для этого нажмите комбинацию клавиш Win-R и выполните команду « winver ». Если на вашем компьютере установлена Windows 10 с версией 1809 или выше, то все нормально, в противном случае сначала нужно выполнить обновление.

Также нужно открыть меню « Параметры » и зайти в раздел « Приложения – Дополнительные возможности ».

Здесь нужно пролистать список установленных дополнительных компонентов и найти в нем « Клиент OpenSSH ». Если такой компонент присутствует, значит все нормально и можно переходить к следующему шагу. Если нет, то его нужно сначала установить с помощью меню « Добавить компонент ».
Обратите внимание, не нужно путать « Клиент OpenSSH » и « Сервер OpenSSH ». Для подключения по SSH вам нужен именно клиент.

Также клиент OpenSSH можно установить с помощью PowerShell. Для этого запустите консоль PowerShell с правами администратора и выполните следующую команду:
Более подробно об установке и удалении клиента OpenSSH можно почитать в официальной документации Майкрософт.

Если версия Windows 10 подходящая и клиент OpenSSH установлен, то можно начинать подключение по SSH. Для этого запустите обычную командную строку Windows и введите команду « ssh ». В ответ вы должны получить информацию о работе с данной командой.

В общем случае синтаксис команды « ssh » выглядит следующем образом:
Где « user » — это имя пользователя на удаленном сервере, а « server » — это имя компьютера или его ip адрес.
Например, если наш сервер доступен по ip адресу « 192.168.1.214 », а имя пользователя это « aleks », то команда для подключения будет выглядеть так:
После ввода данной команды появится запрос пароля и после этого мы получим доступ к удаленному серверу. Также при первом подключении с помощью ssh будет появляться запрос на добавление сервера в список известных.

По умолчанию для SSH используется порт 22. Для того чтобы это изменить нужно использовать параметр « -p ». Например, для подключения по порту 2222 нужно выполнить вот такую команду.
Если подключение предполагает использование ключей, то они должны находиться в папке « C:\Users\user\.ssh ». А при подключении путь к приватному ключу нужно указать с помощью параметра « -i ». Например, чтобы использовать ключ « C:\Users\stepu\.ssh\id_rsa » нужно выполнить:
Более подробную информацию о команде « ssh » и ее параметрам можно получить на сайте man.openbsd.org/ssh или на opennet.ru (перевод).
Подключение по SSH через PuTTY
В тех случаях, когда версия Windows 10 не поддерживает OpenSSH (или используется Windows 7) к SSH можно подключаться с помощью программы PyTTY. Скачать установщик данной программы можно на официальном сайте www.putty.org.
После установки программы PyTTY ее можно будет запустить с помощью поиска в меню « Пуск »

Сразу после запуска программы PuTTY появляется окно с настройками подключения. Основными параметры здесь находятся на вкладке « Session », здесь нужно ввести:
- Имя компьютера или IP адрес;
- Порт для подключения (по умолчанию, 22);
- Способ подключения (SSH);
После ввода этих данных можно запускать подключение с помощью кнопки « Open ».

Если для подключения к SSH используются ключи, то путь к приватному ключу нужно указать в разделе « Connection – SSH – Auth ».
Обратите внимание, ключ должен быть сгенерирован программой PuTTYgen, которая устанавливается вместе с PuTTY. Если вы сгенерировали ключи с помощью OpenSSH, то их можно загрузить в PuTTYgen и сохранить в формате подходящем для PuTTy.

Если информация для подключения правильная, то вы увидите консоль с запросом на ввод имени пользователя пароля. Также при первом запуске появится запрос на добавление компьютера в список известных.

После ввода этих данных вы будете подключены к удаленному серверу по SSH.
- Как удалить папку в Linux через терминал (консоль)
- Как открыть файл в терминале Linux
- Как создать файл в Linux через терминал
- Как скопировать файл в Linux через терминал
- Как удалить файл в Linux через терминал
Создатель сайта comp-security.net, автор более 2000 статей о ремонте компьютеров, работе с программами, настройке операционных систем.
Задайте вопрос в комментариях под статьей или на странице «Задать вопрос» и вы обязательно получите ответ.
Introduction
Most of the work in computational chemistry, and other computational fields of science, is done with the Linux terminal. This is because the software we use does not normally come with a graphical interface and also because, once you know how to use it, the terminal allows working very efficiently with large amounts of data.
To work with the terminal, the user enters commands that perform specific tasks. These include reading, creating, and deleting files, filtering lines out of a text file, mass renaming, running calculations, and many more. For instance:
$ is the command prompt (the place you type at), ls is the command we entered (followed by ENTER) and Desktop . is the effect of the ls command, in this case, displaying the contents of the working directory. Working with the terminal is awkward at first because you need to remember the names, syntax, and purpose of the commands but, as you get familiar with it, you will see that it is much more powerful for most tasks than the graphical interfaces you are probably used to.
To run chemical calculations, we typically connect remotely to computers other than the one we are using. There are several reasons for this. First, the calculations may be too complex or too numerous and therefore we need specialized high-performance computers to handle the workload. Second, the remote computer may have software installed that is not available in our desktop; computational chemistry software often have licenses that limit their installation to certain computers. Lastly, information and data can be shared between users of the same remote computer, for instance, if you are working in a research team. This tutorial briefly explains how to connect to another computer remotely using ssh.
The Secure Shell Protocol (ssh)
Our main way of connecting to a remote computer is the ssh (secure shell) protocol. The ssh protocol allows encrypted communication between two machines. Ssh is implemented in a client-server model. The remote computer (the server) you want to connect to runs the ssh server and you use an ssh client installed on your computer to connect to this server. Once the connection is established, the server issues a challenge, typically a request for a password. If you enter the (correct) password, you log into the server. At that point, all the commands you enter will run on the remote machine.
For logging into a computer via ssh you need:
1) The name or IP of the remote machine.
2) The user name of your account in the remote machine.
For the remainder of these tutorials, we will use the following remote computer:
and the username and password that were given to you. As soon as you connect to this machine, you should first change your password by using the passwd command.
To connecting to the server, you first need to install an ssh client on your computer. You have multiple options depending on your operating system. How to do this with a few ssh clients is explained below.
Note: unless you copy large files back and forth, an ssh connection is very lightweight. You can follow these tutorials using a metered connection (e.g. mobile phone data); it won’t impact your data usage significantly.
Microsoft Windows
The Windows Command Line (cmd)
If you are running Windows 10 or a later version, an ssh client may already be available in your system, although you probably want to download and use MobaXterm anyway. To see if this is the case, go to the search bar and write and execute cmd . This will open the system command prompt:

Note: the commands described in these tutorials won’t work in the windows command line because it is using a different shell program (a different interpreter for the user commands).
To connect to the server, type:
where <username> is your user name. The server will ask for your password. If you enter it successfully, you will be greeted with the message of the day and the prompt. You are now connected to the remote computer via ssh.
Note: the password doesn’t show as you type it. If you mess up entering your password, you can clear what you typed by pressing Control-u.
Important: change your password the first time you log in using the passwd command.
To close the remote connection, write exit in the command line or type Control-d. This will terminate the ssh connection and get you back to the local terminal on your computer.
MobaXterm
MobaXterm is a graphical ssh client for Windows. It is not open source but the “home version” is free to use. MobaXterm has some convenient features. It can open multiple ssh sessions and store the connection information, and it also provides an easy way to copy files between both computers.
To install MobaXterm, go to the download page and click on the “download now” button. You can choose whether to install the portable edition (no installation required, recommended) or the installer edition. If you selected the portable edition, unpack the zip file in your desktop and click on the MobaXterm icon to execute it.
The first time you run MobaXterm it will ask for a master password. This master password is used to unlock your saved ssh connection information such that you won’t have to enter your password every time you connect to a remote server (only the first time). Type a secure master password that you will remember. Once you are done, the mobaxterm window will open:

To connect to a remote computer, click on the Session button (top left) and select the ssh tab.

Enter the name or IP of the remote computer in “Remote host”. Check the “Specify username” box and write your user name in the text field. Then, click OK.
Note: it is recommended that you click on the “advanced SSH settings” and deselect “X11-forwarding”. This will prevent the server from trying to open windows on your computer. Unless you have a very fast internet connection, this is painfully slow.
Note: if a Windows Firewall window pops up, click “allow access” to allow MobaXterm to establish the ssh connection.
A terminal will now open and ask for your password. Enter your password (the letters won’t show; you can clear what you typed with Control-u). If you do this correctly, you will be logged into the remote server. Before that, MobaXterm will likely ask whether you want to store the connection information. If you say “yes”, you won’t have to enter the password again (only the master password when you open MobaXterm).
To close the ssh connection, type exit or press Control-d.
Note: your session details are saved. You can reconnect to the same server by double clicking on the server name in the left tab.
Note: MobaXterm also provides a terminal that runs on your own computer. You can open this by clicking on “start local terminal”, in the large area on the right. Most of the commands we will see work in this terminal. However, some you will have to install:
and some won’t be installable at all (e.g. Gaussian). You can use the ssh command in the local terminal to connect to a remote server, as in Linux.
Linux and OSX
To use the ssh client on Linux and OSX, you need to open a terminal. On OSX, you can do this by using the spotlight search (with Command-Space ) and then typing terminal. On Linux, how to open a terminal depends on the distribution you use, but typically can be done via the menus of your window manager or by typing “terminal” in the application search bar.
The terminal you opened is running on your local computer. To connect to the remote server, do:
where <username> is your user name on the remote machine.
Note: Depending on the Linux distribution/OSX version, the commands in these tutorials may or may not work on your local terminal. We use the bash shell as the command interpreter. To find out which shell you are using, enter echo $SHELL and press enter—if it is not /bin/bash , expect some differences.
Transfering Files with Secure Copy (scp)
MobaXterm
Copying files between the local and remote computer can be done easily using the MobaXterm graphical interface. Once the ssh session is open, you will see the contents of the remote computer on the left pane of the MobaXterm window:

To transfer files or directories between computers, simply drag and drop in this pane. You can also right click on a file or directory and click on the “download” button.
Note: directory = folder, file = document, program = application.
Note: there are standalone scp programs that allow transfering files but not using the terminal (i.e. they are not ssh clients). WinSCP is a popular one.
Linux, OSX, and Windows Command Line
scp is a companion program to the ssh client that is commonly used to transfer files between computers using the terminal. To use scp , do:
For instance, to copy the file bleh from the remote computer to the working directory on the local computer, do:
and to copy bleh from the local to the remote computer:
The meaning of this syntax and the usage of scp will be discussed in the next tutorials (xx).
There are also graphical interfaces for transfering files between computers using scp both in Linux and OSX, similar to MobaXterm and WinSCP. On Linux, for instance, there is nautilus (in GNOME) and konqueror (KDE). You can install these programs from your software repository.
Changing your Password (passwd)
For security reasons and for ease of use, it is important that the first thing you do when you connect to a remote computer for the first time is to change your password. You do this by using the passwd command:
The command will first ask for your current password, then ask you to enter the new password twice. As usual, what you type will not be shown on the screen and you can clear what you typed by pressing Control-u. Choose a password that you will remember and that is secure (long, mixing symbols and numbers, and not an obvious dictionary word, “qwerty”, or “123456”).