PuTTY on Linux
Installation and usage across Linux distributions
Introduction: PuTTY on Linux Distributions
While PuTTY originated as a Windows SSH client, it's available on Linux systems. However, most Linux users prefer native SSH tools since Linux has built-in OpenSSH support. This guide covers PuTTY installation across major Linux distributions and explains when you might want to use it.
Note: Most Linux distributions come with OpenSSH pre-installed, which is generally more powerful and better integrated than PuTTY. Consider using native SSH tools unless you specifically need PuTTY's features.
Installation Steps by Distribution
Debian & Debian-based (Ubuntu, Linux Mint, Pop!_OS)
# Update package list
$ sudo apt update
# Install PuTTY and all tools
$ sudo apt install putty putty-tools -y
# Or install specific components
$ sudo apt install putty # GUI only
$ sudo apt install putty-tools # Command-line tools (plink, pscp, psftp)
# Verify installation
$ putty --version
$ plink --version
Fedora, CentOS, RHEL
# Fedora (DNF)
$ sudo dnf install putty -y
# CentOS/RHEL 8+ (DNF)
$ sudo dnf install putty -y
# CentOS/RHEL 7 (YUM)
$ sudo yum install putty -y
# Enable EPEL repository if putty not found
$ sudo dnf install epel-release
$ sudo dnf install putty
# Verify
$ putty --version
Arch Linux & Manjaro
# Install from official repositories
$ sudo pacman -S putty
# Or build from AUR
$ yay -S putty-git
# Verify
$ putty --version
openSUSE
# openSUSE Leap/Tumbleweed
$ sudo zypper install putty
# Verify
$ putty --version
Alpine Linux
# Install PuTTY
$ sudo apk add putty
# Verify
$ putty --version
Universal: Snap Package
# Install snap if not present
$ sudo apt install snapd # Debian/Ubuntu
$ sudo dnf install snapd # Fedora
$ sudo pacman -S snapd # Arch
# Install PuTTY via snap
$ sudo snap install putty-jamesodhunt
# Run
$ putty-jamesodhunt.putty
CLI vs GUI PuTTY
GUI Mode (putty)
Launch the graphical interface:
# Launch PuTTY GUI
$ putty
# Run in background
$ putty &
# Load saved session
$ putty -load "SessionName"
# Connect directly
$ putty user@hostname
Command-Line Mode (plink)
plink is PuTTY's command-line SSH client, similar to OpenSSH's ssh command:
# Basic connection
$ plink user@hostname
# With password (not recommended for scripts)
$ plink user@hostname -pw password
# With SSH key
$ plink user@hostname -i /path/to/private-key.ppk
# Execute remote command
$ plink user@hostname "uptime"
# Execute multiple commands
$ plink user@hostname "cd /var/www && ls -la"
# Interactive session
$ plink -t user@hostname
# Specify port
$ plink -P 2222 user@hostname
# Batch mode (non-interactive)
$ plink -batch user@hostname "command"
Using plink (Command-line PuTTY)
Basic Usage
# Connect with username
$ plink admin@192.168.1.100
# Specify protocol explicitly
$ plink -ssh user@hostname
# Use specific SSH version
$ plink -2 user@hostname # Force SSH-2
# Verbose output (debugging)
$ plink -v user@hostname
Authentication Methods
# Password authentication (interactive)
$ plink user@hostname
# Password from command line (insecure)
$ plink user@hostname -pw MyPassword
# Private key authentication
$ plink -i ~/.ssh/mykey.ppk user@hostname
# Use Pageant for key management
$ pageant ~/.ssh/mykey.ppk
$ plink user@hostname # Uses key from Pageant
Advanced plink Features
# Port forwarding (local)
$ plink -L 8080:localhost:80 user@hostname
# Dynamic SOCKS proxy
$ plink -D 1080 user@hostname
# X11 forwarding
$ plink -X user@hostname
# Compression
$ plink -C user@hostname
# Agent forwarding
$ plink -A user@hostname
# Keep connection alive
$ plink -o "ServerAliveInterval=60" user@hostname
Other PuTTY Tools
pscp - Secure Copy
# Copy file to server
$ pscp localfile.txt user@hostname:/remote/path/
# Copy file from server
$ pscp user@hostname:/remote/file.txt ./local/
# Copy directory recursively
$ pscp -r /local/directory user@hostname:/remote/
# Use SSH key
$ pscp -i ~/.ssh/key.ppk file.txt user@hostname:/path/
# Specify port
$ pscp -P 2222 file.txt user@hostname:/path/
psftp - Secure FTP Client
# Start interactive SFTP session
$ psftp user@hostname
# Commands within psftp:
psftp> ls # List remote files
psftp> cd /path # Change remote directory
psftp> lcd /local/path # Change local directory
psftp> get remotefile.txt # Download file
psftp> put localfile.txt # Upload file
psftp> mget *.txt # Download multiple files
psftp> mput *.txt # Upload multiple files
psftp> rm file.txt # Delete remote file
psftp> mkdir newdir # Create directory
psftp> bye # Exit
# Non-interactive mode
$ psftp -b commands.txt user@hostname
puttygen - Key Generator
# Generate new RSA key
$ puttygen -t rsa -b 4096 -o mykey.ppk
# Generate ED25519 key
$ puttygen -t ed25519 -o mykey.ppk
# Convert OpenSSH key to PuTTY format
$ puttygen ~/.ssh/id_rsa -o converted.ppk -O private
# Convert PuTTY key to OpenSSH format
$ puttygen mykey.ppk -O private-openssh -o id_rsa
# Extract public key
$ puttygen mykey.ppk -L # Display public key
$ puttygen mykey.ppk -o public.txt -O public-openssh
pageant - SSH Agent
# Load key into agent
$ pageant ~/.ssh/mykey.ppk
# Load multiple keys
$ pageant key1.ppk key2.ppk key3.ppk
# List loaded keys
$ pageant -l
# Run in background
$ eval `pageant -s ~/.ssh/mykey.ppk`
Why Use OpenSSH Instead?
OpenSSH Advantages on Linux:
- ✅ Pre-installed on most distributions
- ✅ Better Linux integration
- ✅ More powerful and flexible
- ✅ Native key format compatibility
- ✅ Better scripting capabilities
- ✅ Standard tool across Unix/Linux systems
- ✅ Active development and security updates
- ✅ SSH config file support (~/.ssh/config)
- ✅ Connection multiplexing
- ✅ ProxyJump and ProxyCommand support
OpenSSH Quick Reference
# Basic connection
$ ssh user@hostname
# With port
$ ssh -p 2222 user@hostname
# With key
$ ssh -i ~/.ssh/id_rsa user@hostname
# Execute command
$ ssh user@hostname 'uptime'
# Copy files
$ scp file.txt user@hostname:/path/
$ scp -r directory/ user@hostname:/path/
# SFTP
$ sftp user@hostname
# Local port forwarding
$ ssh -L 8080:localhost:80 user@hostname
# Dynamic SOCKS proxy
$ ssh -D 1080 user@hostname
# X11 forwarding
$ ssh -X user@hostname
# Keep alive
$ ssh -o ServerAliveInterval=60 user@hostname
# Using config file
$ cat ~/.ssh/config
Host myserver
HostName 192.168.1.100
User admin
Port 2222
IdentityFile ~/.ssh/mykey
$ ssh myserver # Uses config
Troubleshooting
PuTTY Command Not Found
# Check if installed
$ which putty
$ which plink
# If not found, install
$ sudo apt install putty putty-tools # Debian/Ubuntu
$ sudo dnf install putty # Fedora
$ sudo pacman -S putty # Arch
# Verify PATH
$ echo $PATH
GUI Won't Launch
Solutions:
- Check X server:
$ echo $DISPLAY
- For WSL: Install X server (VcXsrv, X410)
- For SSH session: Enable X11 forwarding
$ ssh -X
- Try:
$ export DISPLAY=:0
Key Format Incompatibility
# Convert OpenSSH to PuTTY format
$ puttygen ~/.ssh/id_rsa -o converted.ppk -O private
# Convert PuTTY to OpenSSH format
$ puttygen mykey.ppk -O private-openssh -o id_rsa
$ chmod 600 id_rsa
When to Use PuTTY on Linux
Consider using PuTTY on Linux when:
- You need compatibility with PuTTY sessions from Windows
- You prefer PuTTY's GUI for session management
- You're transitioning from Windows and familiar with PuTTY
- You need to use .ppk key files without conversion
- Specific scripts or tools require plink
Use OpenSSH instead when:
- You want better Linux integration
- You need advanced features (multiplexing, proxyjump)
- You want to use SSH config files
- You're writing automation scripts
- You value community support and updates