How to SSH Into a Server or OLT
Today I learned how to SSH into a server and an Optical Line Terminal (OLT). This is a fundamental skill for remote server administration and network management.
Basic SSH Command
The basic syntax for SSH is surprisingly simple:
ssh username@hostname
For example:
ssh admin@192.168.1.100
SSH Authentication Methods
I learned there are two main ways to authenticate:
- Password Authentication: Simply enter your password when prompted
- Key-Based Authentication: More secure, uses a public/private key pair
Setting Up Key-Based Authentication
To set up key-based authentication:
# Generate SSH key pair
ssh-keygen -t rsa -b 4096
# Copy public key to server
ssh-copy-id username@hostname
SSH into an OLT
Connecting to an OLT (Optical Line Terminal) has some specific considerations:
- Default Credentials: Many OLTs have default credentials like
admin/adminorroot/admin - Telnet vs SSH: Older OLTs might only support Telnet (less secure)
- Port Differences: Some OLTs use non-standard SSH ports
Example command for connecting to an OLT:
ssh -p 22 admin@192.168.1.10
Useful SSH Commands Once Connected
Once connected to a server or OLT, these commands came in handy:
# View system information
uname -a
# Check running processes
ps aux
# View network interfaces
ifconfig
# For OLTs: Show connected ONUs
show pon onulist
# For OLTs: Check optical power levels
show pon power-info
SSH Configuration Tips
I also learned some useful SSH configuration tricks:
- Config File: Create
~/.ssh/configto store connection settings - Connection Persistence: Use
ServerAliveInterval 60to keep connections alive - Aliases: Set up shortcuts for frequent connections
Example config file:
Host myserver
HostName 192.168.1.100
User admin
Port 22
IdentityFile ~/.ssh/id_rsa
ServerAliveInterval 60
Then simply use:
ssh myserver
Security Best Practices
Important security considerations:
- Disable Password Authentication when possible
- Use Strong Keys (RSA 4096 bits or ED25519)
- Change Default Ports to reduce automated attacks
- Implement Fail2Ban to prevent brute force attempts
- Keep Software Updated to patch security vulnerabilities
SSH is an incredibly powerful tool for remote administration. I’m glad I took the time to learn it properly!
