Google: Difference between revisions

Content added Content deleted
Line 120:
 
== SSH to remote server ==
;GCP VM SSH Connection Timed out
GCP VM
SSH Packets are reaching Destination? TCPDump on Destination. If not check:
Timed out
- IP Correct
- DNS Correct
- Port Correct
If yes check:
- Reply packets going or not? if going, check Router reverse routes.
- IPTables Rejecting packets (Flush IPTabeles -F)
- Packets received on correct interface? (SSH might be listening on wrong port - ListenAddress )
 
Any traffic reaching Server? If not check:
SSH Config File:
- Networking Config
- Interface check? correct ip on correct interface?
 
If Yes check:
- Firewall blocking traffic for port 22?
- Firewall blocking all external traffic?
 
 
;SSH Config File:
/etc/ssh/sshd_config # sshd server configuration file
Port 22
Line 138 ⟶ 154:
/etc/ssh/sshd_config # ssh client configuration file
 
;Restart SSHD:
sudo systemctl restart sshd.service
sudo systemctl status sshd.service
 
;Wrong IP:
ssh: connect to host 192.168.1.51 port 22: No route to host
 
;Wrong Port:
ssh: connect to host 192.168.1.50 port 2222: Connection refused
 
;Netstat:
netstat -ant | grep 22
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
 
;Journalctl:
journalctl -xe