This site contains affiliate links — if you sign up through them we may earn a commission at no extra cost to you, without affecting our editorial neutrality. Details

SSH Guide Thailand

SSH Guide Thailand

What is SSH

SSH (Secure Shell) is a protocol for securely connecting to and controlling servers remotely via command line. It encrypts all traffic — unlike Telnet which sends data in plain text. SSH is the default access method for VPS and Linux cloud servers.

SSH

Command: ssh username@hostname or ssh username@IP — port 22 by default. If port changed, use -p: ssh -p 2222 user@server. First connection asks for fingerprint confirmation — type yes to trust.

Interested in AsiaGB?

Check the latest plans and promotions on the official site.

Visit AsiaGB →

SSH Windows

Windows 10/11 has a built-in SSH client. Open Command Prompt or PowerShell and type ssh user@server. Or use PuTTY (free) for GUI that easily saves sessions. Windows Terminal + OpenSSH Client recommended for developers.

SSH Mac Linux

Mac and Linux have SSH client pre-installed. Open Terminal and type ssh user@server directly. Mac Terminal, iTerm2, or Linux Gnome Terminal all support SSH without any additional installation.

SSH Linux

Once connected, use Linux commands: ls (list files), cd (change directory), mkdir (create folder), rm (delete), cp (copy), mv (move), cat (read file), nano/vim (edit file), chmod (change permission), chown (change owner).

SSH Key Authentication

SSH Key is more secure than passwords because no password is transmitted over the network. Create key: ssh-keygen -t ed25519 gives ~/.ssh/id_ed25519 (private key) and ~/.ssh/id_ed25519.pub (public key). Copy public key to server: ssh-copy-id user@server.

Security: SSH

Disable root login: PermitRootLogin no in /etc/ssh/sshd_config. Use a separate user with sudo instead. Use SSH Key instead of password. Disable password authentication: PasswordAuthentication no if using keys. Install Fail2Ban to block IPs with repeated failed logins.

Port SSH

Default port 22 is frequently scanned by bots. Changing to another port (e.g., 2222) reduces log noise. Edit /etc/ssh/sshd_config, change Port 22 to new port. Must restart sshd and open new port in firewall before closing current session.

SCP SFTP SSH

SCP (Secure Copy) transfers files via SSH: scp file.txt user@server:/path/ SFTP is FTP over SSH: sftp user@server. FileZilla supports SFTP protocol — more secure than regular FTP. rsync syncs only changed files in a directory.

Frequently Asked Questions (FAQ)

How are SSH and SFTP different?
SSH is a protocol for connecting to a server via the command line. SFTP (SSH File Transfer Protocol) is a subsystem of SSH used to transfer files, running on port 22 just like SSH. FileZilla and WinSCP support SFTP to browse and transfer files via a GUI.
Is root login over SSH dangerous?
Dangerous. Bots brute-force user root@server constantly. You should disable it with PermitRootLogin no and use a regular user + sudo instead. If you need to do something in a root context, you can do it via sudo without logging in as root directly.
How does an SSH key pair work?
An SSH key pair consists of a private key (kept on your machine) and a public key (placed on the server). When you log in, the server sends a challenge, which you answer using the private key. If the public key matches, the server successfully authenticates you. No password is sent over the network at all.
What do I do if I forget the root password?
Most VPSes have a VNC console or web console accessible without SSH. Enter the console and reset the password, or boot into recovery mode. Cloud providers such as DigitalOcean and AsiaGB have a console in the dashboard to access the server even when SSH isn't working.