Key Takeaways
To install PuTTY on Ubuntu, you can execute the following command: "sudo apt install putty". Make sure you have enabled the universe repository before proceeding. For Fedora, use the default package manager "yum/dnf", and for Manjaro, use "pacman" as the default package manager.
To install PuTTY, you have the option to use a GUI-based method. On Ubuntu, simply use the Synaptic package manager. For Fedora and Manjaro, their default software center can be utilized for PuTTY installation.
Alternatively, PuTTY can be acquired through its source code. Download the PuTTY source code using the "wget" command and extract the file content with the "tar" command. Then, proceed to build it using the necessary tools.
PuTTY, an originally Windows-based terminal emulator, is renowned for its versatility. As one of the top choices among SSH clients for Windows, PuTTY has garnered significant demand. Its availability, however, is not restricted solely to the Windows operating system; it has been adapted for other operating systems such as Linux.
What is PuTTY? (And Why You Need It on Linux)
Imagine you work as a system engineer or developer in an IT company, where you handle numerous files on a Linux system. However, your personal system operates on Windows. So, what should you do? Is it necessary to install Linux? Don't rush, because PuTTY is here to save the day.
With PuTTY, you can effortlessly connect to remote servers and devices using different protocols such as SSH and Telnet. Using PuTTY, you have the ability to open GUI applications remotely over SSH servers. For Sysadmins, PuTTY proves invaluable in accessing other computers and remotely communicating with their serial ports.
How to Install PuTTY
Why is PuTTY SSH significant even though Linux distros already have SSH capabilities and OpenSSH in their terminals? Simply put, PuTTY is a popular choice among Windows users, and if you're one of them, you might feel more at ease using it. In addition, PuTTY makes it easier to save your various SSH sessions. Unlike command-line tools like the default Linux terminal, manual editing of the SSH config file can be challenging. With PuTTY's graphical interface, you can conveniently save your SSH connections. Moreover, PuTTY simplifies debugging and connecting to raw sockets and serial ports.Most Linux distributions do not include PuTTY as a pre-installed software. Nevertheless, you have the option to install PuTTY from the default repositories of Linux distributions. In the case of Debian-based distros, PuTTY can be found in the universe repository.
Install PuTTY Using the Terminal
Installing various packages from the Linux terminal is a simple and efficient method. PuTTY can also be installed on Linux by utilizing commands within the terminal.
To install PuTTY on Ubuntu, enable the universe repository which contains the PuTTY package.
sudo add-apt-repository universe
After enabling the universe repository, update the system to recognize its new access rights, with apt command:
sudo apt update
To install PuTTY from the command line—run the apt install command:
sudo apt install putty
The above command will successfully install the PuTTY in your system. Run PuTTY from application manager or terminal.
To remove the PuTTY use:
sudo apt remove putty
You can install PuTTY on Debian and its related distributions by using apt-get:
sudo apt-get install putty
PuTTY is also available on Arch Linux default repositories. To install it, run the following command:
sudo pacman -S putty
Install PuTTY on CentOS, RHEL, and Fedora through the distro’s default package manager such as yum or dnf.
sudo yum install puttyORsudo dnf install putty
To install PuTTY-related tools like pscp, psftp, plink, pageant, and puttygen, run this command:
sudo apt install putty-tools
Install PuTTY Using a Graphical Package Manager
Opting for a graphical user interface (GUI) can be your preferred choice when it comes to installing and handling software. Linux distributions provide convenient software centers with pre-installed GUI interfaces. These software centers enable you to efficiently manage and install numerous software applications without the requirement of memorizing Linux commands.
To begin, install the Synaptic package manager by using the following command line:
sudo apt install synaptic
Open Synaptic using the command line or application manager.
Inside the Synaptic search for the "putty" package.
In the main window, find the PuTTY package. Select the checkbox beside the "putty" package and right-click to indicate it for installation. If required, you can also designate other PuTTY-related tools for installation.
Once you've marked the package for installation, click on the "Apply" button.
Review the list displayed by Synaptic to ensure that it includes PuTTY and its dependencies. Click "Apply" to begin installation of PuTTY and its dependencies.
You'll see a progress bar indicating the PuTTY installation. Wait for it until it finishes.
After the successful installation of PuTTY, a confirmation message will appear.
You can now launch PuTTY either from the application launcher or by running "putty" in the terminal.
In Fedora, you have the option to install PuTTY as a Flatpak application directly from the GNOME Software Center. This convenient app store offers a user-friendly interface for conveniently managing software packages using the dnf package manager.
Install PuTTY Using the Source Code
Like Fedora, PuTTY can be installed directly on Manjaro using the Pamac package manager. Pamac serves as the graphical front-end for the pacman package manager, enabling access to both the official Manjaro repositories and the Arch User Repository (AUR).Most individuals choose to utilize package managers for installing packages and software on Linux, which is perfectly acceptable. These package managers come equipped with pre-compiled binary packages that can be easily installed using a single command. However, it is also possible to directly install software from its source code.
There are several advantages to installing software from source code as opposed to relying on package managers. Firstly, you gain access to the latest version of the software, allowing you to stay up-to-date with any modifications or improvements. This includes important security patches or innovative features that may not yet be included in the binary packages. Additionally, installing from source code enables you to have greater control over the installation process, such as selecting specific features and options.
To install these tools and libraries, start by updating the local package repository.
sudo apt-get update
Now install build essential tools using following command:
sudo apt-get install build-essential cmake
build-essential includes essential build tools like gcc, g++, and make. cmake is the build system we'll be using.
Now download the PuTTY source code using the wget command. You can also directly download the tar file of PuTTY source code from the website.
Replace the URL below with the actual URL for the latest version:
wget https://the.earth.li/~sgtatham/putty/latest/putty-0.79.tar.gz
Use tar command to extract the downloaded source code. If you have downloaded any other version, replace tar file name with the downloaded filename:
tar -xzvf putty-0.79.tar.gz
The tar command will create a directory with the PuTTY source code. Navigate to the PuTTY source code directory using the below cd command:
cd putty-0.79/
Now to build PuTTY source code, create a new "build" directory. This will separate the build files from source code. Next, navigate to build directory:
mkdir buildcd build
Use CMake to configure the build. As we are building the PuTTY in its source directory, you can also specify a different path in this command:
cmake ..
This will generate build files based on your system.
When cmake is used with a single dot (.), the project is configured within the same folder that contains the source files. On the other hand, when cmake is used with a double dot (..), the project is configured in a separate folder specifically for building purposes. This approach offers a more organized method of utilizing CMake for project building.
Once the configuration process is finished, proceed with building PuTTY by executing the make command. This command will compile the source code of PuTTY.
make
To install PuTTY system-wide, you can use the following command:
sudo make install
This will copy PuTTY binaries and related files to appropriate system directories.
You can now run PuTTY from your terminal:
putty
This will launch the PuTTY application, and you can use it to connect to remote servers.
After the installation, you might encounter an error message stating "Command 'putty' not found" while attempting to execute PuTTY. This error typically arises when the system is unable to locate the PuTTY executable in any of the directories mentioned in your system's PATH.
To fix this, you need to run the following command—after you compile PuTTY:
sudo make install
The PuTTY binary will be relocated from the build directory to the /usr/local/bin directory, ensuring it is available system-wide. Additionally, the system's PATH environment variable will be updated to incorporate the installation directory of PuTTY (/usr/local/bin).
You might also come across an error message stating "fatal error: gtk/gtk.h: No such file or directory."
The error message you're encountering is connected to the absence of a header file (gtk/gtk.h) while compiling PuTTY from its source code. This informs us that PuTTY relies on the GTK (GIMP Toolkit) library. Unfortunately, your system lacks the required GTK development files.
To fix this error install the GTK development package on your Linux system.
sudo apt-get install libgtk-3-dev
To remove PuTTY installed through source code use
sudo rm /usr/local/bin/putty
PuTTY Remote Control Features
PuTTY is highly favored among system administrators and developers for its exceptional remote-control capabilities. It allows you to execute local scripts on a remote Linux server and access GUI applications remotely. Additionally, PuTTY facilitates file sharing between local and remote computers.
Moreover, PuTTY has the capability to execute commands on a remote machine, display a remote computer's screen on your local device, and securely log in to remote computers. It also enables X11 forwarding for those who need to utilize graphical applications, allowing you to directly run them from a remote server on your local machine.