คู่มือการติดตั้งและใช้งาน SSH Server
SSH (Secure Shell) เป็นโปรโตคอลสำหรับเชื่อมต่อและบริหารจัดการ Linux Server จากระยะไกลผ่าน Command Line โดยข้อมูลทั้งหมดจะถูกเข้ารหัสเพื่อความปลอดภัย
sudo apt update sudo apt upgrade -y
sudo apt install openssh-server -y
sudo systemctl status sshผลลัพธ์ที่ถูกต้อง
Active: active (running)
sudo systemctl enable ssh
ip -br addrตัวอย่าง
ens33 UP 192.168.1.100/24
ssh username@192.168.1.100ตัวอย่าง
ssh admin@192.168.1.100Windows PowerShell
ssh admin@192.168.1.100
Are you sure you want to continue connecting (yes/no)?พิมพ์
yesจากนั้นกรอกรหัสผ่านของผู้ใช้งาน
pwd ls cd mkdir test rm -rf test sudo reboot sudo shutdown now
exitหรือ
logout
sudo nano /etc/ssh/sshd_configค้นหา
#Port 22เปลี่ยนเป็น
Port 2222Restart Service
sudo systemctl restart sshเชื่อมต่อด้วย
ssh -p 2222 username@IP-Address
sudo apt install openssh-server -y sudo systemctl status ssh sudo systemctl enable ssh ip -br addr ssh username@IP-Address exit
ลบ key เก่าออกแล้วเชื่อมต่อใหม่
PowerShell:
ssh-keygen -R 192.168.1.199
จะลบ entry เก่าออกจาก known_hosts
จากนั้นเชื่อมต่อใหม่:
ssh ton@192.168.1.199