Understanding SSH Service: Structure, Authentication, Startup, and Usage
This article explains the fundamentals of SSH, covering its purpose, architecture, password and key authentication methods, how to verify installation and service status, and practical commands for connecting, transferring files with scp, and using sftp on Linux systems.
What is SSH Service SSH encrypts data before transmission to ensure secure sessions and includes the remote copy command scp .
SSH Structure The service consists of server software (OpenSSH) and clients such as SSH, SecureCRT, and Xshell, listening on port 22. It has two versions, 1.x (insecure) and 2.x, with the daemon process named sshd .
Authentication Types
1. Password‑based authentication uses a username, password, and server IP, e.g.:
[root@Centos ~]# ssh -p22 [email protected]
The client prompts for host authenticity, adds the RSA key fingerprint to ~/.ssh/known_hosts , and then asks for the password.
2. Key‑based authentication requires a pre‑generated key pair, with the public key placed on the server and the private key kept on the client, enabling encrypted data transfer without a password.
Starting the SSH Service Verify installation:
[root@Centos ~]# rpm -qa | grep -Ei "openssh"
Check service status:
[root@Centos ~]# /etc/init.d/sshd status
Confirm listening port:
[root@Centos ~]# netstat -lntup | grep ssh
Identify the owning process:
[root@Centos ~]# lsof -i tcp:22
SSH Connection Examples Connect to a remote host:
[root@Centos ~]# ssh -p22 [email protected]
Execute remote commands such as free -m to view memory usage.
Transfer files with scp :
[root@Centos tmp]# scp -P22 tar.gz.20160820 [email protected]:/tmp/
Verify the file on the remote host with ls /tmp .
Additional SSH‑Related Commands
scp options include -P for port, -p to preserve attributes, and -r for recursive copy.
Use the SFTP subsystem for interactive file transfers:
[root@Centos tmp]# sftp -oport=22 [email protected]
Upload a directory (skipping non‑regular files) and download files back to the local host with put and get commands.
Practical DevOps Architecture
Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.