deepin 默認情況下,只打開631端口,即 cpus 端口,無法使用 ssh 默認端口22。如何打開?
deepin@deepin-PC:~$ sudo netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 699/cupsd
tcp6 0 0 ::1:631 :::* LISTEN 699/cupsd
deepin@deepin-PC:~$ service ssh start
#彈窗輸入密碼
deepin@deepin-PC:~$ service ssh status
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; disabled; vendor preset: enabled)
Active: active (running) since Thu 2021-12-02 18:44:21 CST; 4s ago
Docs: man:sshd(8)
man:sshd_config(5)
Process: 6481 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
Main PID: 6482 (sshd)
Tasks: 3 (limit: 4581)
Memory: 3.1M
CGroup: /system.slice/ssh.service
├─6482 /usr/sbin/sshd -D
├─6483 sshd: [accepted]
└─6484 sshd: [net]
deepin@deepin-PC:~$ sudo netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 6482/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 699/cupsd
打開效果見代碼。