PuTTY is a versatile and widely-used SSH client that allows users to connect securely to remote servers. It’s particularly useful for managing remote systems via secure shell (SSH) connections, but it also supports other network protocols like Telnet, rlogin, and raw TCP connections. PuTTY is lightweight, reliable, and known for its simplicity and ease of use, making it an essential tool for system administrators and developers who need to access remote servers.
To install PuTTY on Ubuntu 24.04, 22.04, or 20.04, you can use the command-line terminal. This method provides a straightforward and efficient way to get PuTTY up and running on your system, enabling secure connections to remote servers. This guide will walk you through the installation process step by step.
Update Ubuntu Before PuTTy Installation
Before proceeding, ensure your system is up-to-date by executing the following terminal command:
sudo apt update && sudo apt upgrade
Install PuTTY via APT Command
Use the terminal command below to install the software. Note that Ubuntu’s default repository already includes the software, simplifying the installation process.
sudo apt install putty putty-tools
To confirm the successful installation of PuTTy, you can verify its version using the following steps.
putty --version
Launch PuTTY SSH Client Graphical Interface
There are two ways to launch the PuTTy user interface, one of which is through the command line terminal.
CLI Command to Launch PuTTy SSH Client UI
First, you can enter the following command in your terminal:
putty
GUI Path to Launch PuTTy SSH Client UI
The other method for launching PuTTy is through the graphical user interface by clicking on the PuTTy icon in your application launcher:
Activities > Show Applications > PuTTY SSH Client.
PuTTy Terminal Commands Examples
In this section, we’ll explore some of the most common commands you might use with PuTTY, including the secure copy client (SCP), utilizing SFTP to manage remote server files securely, and generating SSH RSA and DSA keys.
Connect to a remote server
The basic command to connect to a remote server using PuTTY is:
putty [user@]hostname
Where [user@] is the username you want to use to connect to the remote server, and hostname is the hostname or IP address of the remote server.
Example:
putty root@192.168.1.100
Using the username root, this command will connect to the remote server at IP address 192.168.1.100.
Transfer files securely with PuTTY SCP
The secure copy client (SCP) in PuTTY lets you transfer files between your local machine and a remote server. SCP uses SFTP (SSH File Transfer Protocol) to ensure the secure transfer of your data.
The basic command to transfer a file from your local machine to a remote server using SCP is:
scp local_file user@host:remote_file
Where local_file is the path to the file on your local machine, user@host is the username and hostname of the remote server, and remote_file is the path to the file on the remote server.
Example:
scp /home/user/file.txt root@192.168.1.100:/root/file.txt
This command will transfer the file /home/user/file.txt from your local machine to the remote server at IP address 192.168.1.100, placing it in the /root directory on the remote server.
puttygen
This will launch the PuTTY Key Generator, where you can generate RSA or DSA keys. Select the type of key you want to generate and follow the on-screen instructions to generate your key.
Additional PuTTY SSH Client Commands
Remove PuTTY SSH Client
If you want to remove PuTTY from your system, use the following terminal command:
sudo apt remove putty putty-tools
Conclusion
With PuTTY installed on your Ubuntu system, you have a reliable and straightforward tool for managing remote server connections. Using the command-line terminal ensures that the installation is quick and efficient. Regular updates will keep PuTTY secure and compatible with the latest technologies, making it an indispensable part of your remote management toolkit on Ubuntu. Enjoy the simplicity and power that PuTTY brings to your remote server administration tasks.
Buen dia, tengo el siguiente error
(putty:49401): Gtk-CRITICAL **: 09:10:26.330: gtk_box_gadget_distribute: assertion ‘size >= 0’ failed in GtkScrollbar
(putty:49401): Gtk-CRITICAL **: 09:10:26.334: gtk_box_gadget_distribute: assertion ‘size >= 0’ failed in GtkScrollbar
(putty:49401): Gtk-CRITICAL **: 09:10:26.337: gtk_box_gadget_distribute: assertion ‘size >= 0’ failed in GtkScrollbar
It looks like you are encountering a Gtk-CRITICAL error while trying to run PuTTy on Ubuntu. This issue is related to GTK, the graphical user interface library that PuTTy uses.
Here are a few steps to troubleshoot and resolve the issue:
Step 1: Update the System
Ensure the system is fully updated to rule out any bugs or issues that have been fixed in recent updates.
Open a terminal and run:
sudo apt update
sudo apt upgrade
Step 2: Reinstall PuTTy and GTK Libraries
Sometimes, reinstalling PuTTy and its dependencies can resolve issues.
Run the following commands:
sudo apt remove putty
sudo apt install –reinstall libgtk-3-0 libgdk-pixbuf2.0-0
sudo apt install putty
Step 3: Check for Missing Dependencies
Ensure all necessary dependencies for GTK are installed.
Run:
sudo apt install -f
Step 4: Run PuTTy with Debugging
Run PuTTy from the terminal to see if there are any additional error messages that can help identify the issue.
Open a terminal and run:
putty
Step 5: Try Running PuTTy as Root
Sometimes running an application as a root user can bypass permission-related issues.
Run:
sudo putty
Putty only connect to a serial port if running as root. Why?
Thank you for your comment Bruno and sorry for late reply.
In Linux, access to serial ports (e.g., /dev/ttyS0, /dev/ttyUSB0) is restricted by default to the root user for security reasons. Non-root users need specific permissions to access these ports.
The solution involves adding the user to the dialout group, which has access to serial ports, and ensuring that the serial port device files have the correct permissions.
Step 1: Add User to Dialout Group
Add the user to the dialout group, which typically has the necessary permissions for serial ports.
sudo usermod -a -G dialout $USER
Replace $USER with the actual username if you’re not logged in as that user.
Step 2: Log Out and Log Back In
The user needs to log out and log back in for the group membership changes to take effect.
Step 3: Verify Group Membership
Check if the user is in the dialout group.
groups
The output should include dialout.
Step 4: Check and Set Permissions
Verify that the serial port device files have the correct permissions. For example, if using /dev/ttyUSB0:
ls -l /dev/ttyUSB0
The output should look like this:
crw-rw—- 1 root dialout 188, 0 Jun 21 09:10 /dev/ttyUSB0
If the permissions are incorrect, you can set them with:
sudo chmod 666 /dev/ttyUSB0
Thanks for answering
I am already in the dialout group. Other apps, like minicom, works as expected. Any other hint for me?