我似乎无法弄清楚为什么端口 22 永远不允许我通过 SSH 访问我的笔记本电脑。以下是我尝试的方法:
ryan@gigantic-laptop:~$ sudo ufw status
Status: active
To Action From
-- ------ ----
22 ALLOW Anywhere
22 ALLOW Anywhere (v6)
22 ALLOW OUT Anywhere
22 ALLOW OUT Anywhere (v6)
ryan@gigantic-laptop:~$ ssh localhost
ssh: connect to host localhost port 22: Connection refused
或者如果我尝试禁用:
ryan@gigantic-laptop:~$ sudo ufw disable
Firewall stopped and disabled on system startup
ryan@gigantic-laptop:~$ sudo ufw status
Status: inactive
ryan@gigantic-laptop:~$ ssh localhost
ssh: connect to host localhost port 22: Connection refused
ryan@gigantic-laptop:~$ ssh 127.0.0.1
ssh: connect to host 127.0.0.1 port 22: Connection refused
ryan@gigantic-laptop:~$ sudo nmap 127.0.0.1
Starting Nmap 6.00 ( http://nmap.org ) at 2013-02-23 18:14 PST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000016s latency).
Not shown: 999 closed ports
PORT STATE SERVICE
631/tcp open ipp
Nmap done: 1 IP address (1 host up) scanned in 0.09 seconds
我究竟做错了什么?
答案1
我需要安装sudo apt-get install openssh-server
。