1. Understand and Use Essential Tools
πRed Hat Certified System Administrator (RHCSA β EX200)
SSH stands for Secure Shell. It is the main way Linux administrators connect to remote systems securely over a network. In the RHCSA exam, you need to know how to connect, authenticate, and transfer files using SSH.
1. What is SSH and why it is important
- SSH is a protocol that lets you log in to a remote Linux server from your local machine.
- It encrypts your connection, so nobody can eavesdrop.
- It is commonly used to:
- Manage servers remotely.
- Run commands on remote systems.
- Transfer files securely.
Example in IT:
A server in a data center can be managed by an administrator sitting in a different location using SSH.
2. Basic SSH Command
The basic syntax to connect to a remote system:
ssh username@remote_host
usernameβ the user account on the remote system.remote_hostβ the IP address or hostname of the remote system.
Example:
ssh pooja@192.168.1.100
- This will ask for the password of user
poojaon the remote machine with IP192.168.1.100. - Once authenticated, you can execute commands on the remote server.
3. SSH Keys (Password-less Login)
Instead of typing a password every time, you can use SSH key pairs:
- Generate a key pair on your local machine:
ssh-keygen
- This creates two files in
~/.ssh/:id_rsaβ private key (keep safe, do not share)id_rsa.pubβ public key (can be shared to servers)
- Copy your public key to the remote server:
ssh-copy-id username@remote_host
- After this, you can log in without a password:
ssh username@remote_host
IT Example:
Admins often use SSH keys to automate server tasks, like running scripts on 100 servers without typing passwords.
4. SSH Options
Some important SSH options for the exam:
- Specify a port if the server is not using the default (22):
ssh -p 2222 username@remote_host
- Run a single command on remote host without logging in interactively:
ssh username@remote_host "ls -l /var/log"
- Enable verbose mode to troubleshoot connection issues:
ssh -v username@remote_host
5. SSH Configuration File
You can simplify SSH commands using ~/.ssh/config.
Example:
Host server1
HostName 192.168.1.100
User pooja
Port 22
Now you can connect using:
ssh server1
No need to type the username or IP every time.
6. SCP β Secure Copy
SCP is used to transfer files securely over SSH:
- Copy a file from local to remote:
scp /local/path/file.txt username@remote_host:/remote/path/
- Copy a file from remote to local:
scp username@remote_host:/remote/path/file.txt /local/path/
- Copy a directory recursively:
scp -r /local/dir username@remote_host:/remote/dir
IT Example:
Uploading web application files to a remote server for deployment.
7. SFTP β SSH File Transfer Protocol
SFTP is an interactive way to transfer files securely:
sftp username@remote_host
Inside SFTP session:
sftp> ls # list files
sftp> get file.txt # download file
sftp> put file.txt # upload file
sftp> exit # exit session
8. Things to Remember for the Exam
- SSH default port is 22.
- Must know how to connect using username and IP.
- Must know how to use SSH keys for password-less login.
- Must know SCP/SFTP for file transfer.
- Must know SSH options:
-p,-v, running a command remotely. - SSH config file (
~/.ssh/config) can simplify connections.
9. Quick Summary Table
| Task | Command Example |
|---|---|
| Connect to server | ssh pooja@192.168.1.100 |
| Connect with specific port | ssh -p 2222 pooja@192.168.1.100 |
| Generate SSH key pair | ssh-keygen |
| Copy public key to server | ssh-copy-id pooja@192.168.1.100 |
| Run remote command | ssh pooja@192.168.1.100 "ls -l /etc" |
| Copy file to remote server | scp file.txt pooja@192.168.1.100:/tmp |
| Copy file from remote server | scp pooja@192.168.1.100:/tmp/file.txt ./ |
| SFTP session | sftp pooja@192.168.1.100 |
β Key Exam Tip: On RHCSA, you may be asked to connect to a remote server, create keys, copy files, or run a command remotely. Practice these commands until they become second nature.
