Network & System
Networking configuration, SSH setup, and system administration references.
Quick Access
Most Popular:
- SSH Key Generation - Create SSH keys
- CIDR Reference Table - Quick subnet lookup
- Multiple SSH Keys - Manage multiple accounts
SSH & Security
SSH Configuration
Complete SSH setup and management guide:
Key Generation:
- Generate RSA and Ed25519 keys
- Choose key type and size
- Set up passphrases
SSH Agent:
- Start SSH agent
- Add keys to agent
- Configure auto-loading
Multiple Accounts:
- GitHub personal and work
- Multiple Git services
- SSH config file examples
Services:
- Add keys to GitHub
- Add keys to GitLab
- Test SSH connections
Networking
Subnet Reference
CIDR notation and subnet mask reference:
CIDR Basics:
/32- Single host (255.255.255.255)/24- Standard subnet (255.255.255.0) - 254 hosts/16- Large network (255.255.0.0) - 65,534 hosts/8- Very large (255.0.0.0) - 16,777,214 hosts
Private Ranges:
- 10.0.0.0/8 (Class A)
- 172.16.0.0/12 (Class B)
- 192.168.0.0/16 (Class C)
Calculations:
- Subnet formulas
- Network/broadcast addresses
- Usable host ranges
- Subnetting examples
Common Tasks
SSH Setup for GitHub
bash
# 1. Generate SSH key
ssh-keygen -t ed25519 -C "your_email@example.com"
# 2. Start SSH agent and add key
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
# 3. Copy public key
cat ~/.ssh/id_ed25519.pub
# 4. Add to GitHub (Settings → SSH Keys)
# 5. Test connection
ssh -T git@github.comMultiple SSH Keys
Create ~/.ssh/config:
# Personal GitHub
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519_personal
# Work GitHub
Host github-work
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519_workUsage:
bash
# Personal repo
git clone git@github.com:username/repo.git
# Work repo
git clone git@github-work:company/repo.gitSubnet Calculation
Divide /24 into 4 subnets:
Original: 192.168.1.0/24 (254 hosts)
Subnets (/26 each, 62 hosts):
1. 192.168.1.0/26 - IPs: .1 to .62
2. 192.168.1.64/26 - IPs: .65 to .126
3. 192.168.1.128/26 - IPs: .129 to .190
4. 192.168.1.192/26 - IPs: .193 to .254Network Commands
Test Connectivity
Cross-platform:
bash
# Ping
ping google.com
# Trace route
traceroute google.com # Linux/Mac
tracert google.com # Windows
# DNS lookup
nslookup google.com
dig google.com # Linux/MacView Network Configuration
Linux/macOS:
bash
# Network interfaces
ip addr show
ifconfig
# Routing table
ip route
netstat -rn
# Active connections
ss -tulpn
netstat -tulpnWindows:
powershell
# Network configuration
ipconfig /all
# Routing table
route print
# Active connections
netstat -anoFlush DNS Cache
Linux:
bash
sudo systemd-resolve --flush-caches
sudo /etc/init.d/networking restartmacOS:
bash
sudo killall -HUP mDNSResponderWindows:
powershell
ipconfig /flushdnsSSH Troubleshooting
Permission Denied
bash
# Check key permissions
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_ed25519
chmod 644 ~/.ssh/id_ed25519.pub
# Test with verbose output
ssh -vT git@github.com
# Verify key is loaded
ssh-add -lConnection Timeout
bash
# Test connectivity
ping github.com
# Try alternative port
ssh -p 443 git@ssh.github.com
# Check SSH config
cat ~/.ssh/configHost Key Verification Failed
bash
# Remove old host key
ssh-keygen -R github.com
# Or disable strict checking (not recommended)
ssh -o StrictHostKeyChecking=no user@hostNetwork Troubleshooting
Can't Reach Server
bash
# 1. Ping server
ping 192.168.1.100
# 2. Check route
traceroute 192.168.1.100
# 3. Check DNS
nslookup server.com
# 4. Test specific port
telnet server.com 80
nc -vz server.com 80Slow Connection
bash
# Check latency
ping -c 10 server.com
# Trace route with timing
mtr server.com # Linux
# Check bandwidth
speedtest-cli # Install via pipPort Already in Use
Linux/macOS:
bash
# Find process using port 8080
lsof -i :8080
sudo netstat -tulpn | grep :8080
# Kill process
kill -9 <PID>Windows:
powershell
# Find process
netstat -ano | findstr :8080
# Kill process
taskkill /PID <PID> /FSecurity Best Practices
SSH Security
- Use Ed25519 keys (or RSA 4096)
- Always use passphrases
- Different keys for different services
- Rotate keys annually
- Never share private keys
- Use SSH agent for convenience
Network Security
- Use private IP ranges for internal networks
- Implement proper subnetting
- Enable firewall rules
- Monitor network traffic
- Use VPN for remote access
- Regular security audits
Quick Reference
SSH Commands
bash
# Generate key
ssh-keygen -t ed25519 -C "email@example.com"
# Add to agent
ssh-add ~/.ssh/id_ed25519
# Copy public key (Linux)
cat ~/.ssh/id_ed25519.pub | xclip -sel clip
# Copy public key (macOS)
pbcopy < ~/.ssh/id_ed25519.pub
# Copy public key (Windows)
Get-Content ~/.ssh/id_ed25519.pub | clip
# Test connection
ssh -T git@github.comNetwork Commands
bash
# Show IP address
ip addr show # Linux
ifconfig # macOS
ipconfig # Windows
# Show routing table
ip route # Linux
netstat -rn # macOS
route print # Windows
# Active connections
ss -tulpn # Linux
netstat -ano # WindowsSee Also
- Git Commands - Use SSH with Git
- Linux File Operations - SCP file transfers
- Cross-Platform Commands - Network commands