sudo apt install openssh-server
deepin默认没装ssh服务
安装ssh服务后也是连接失败
安装ssh服务后也是连接失败
sudo systemctl enable ssh #开机自启
sudo systemctl start ssh #立即启动ssh服务
sudo systemctl enable ssh #开机自启
sudo systemctl start ssh #立即启动ssh服务
都试过了还是不行,好像是ipv6和ipv4优先级的事,在一个帖子看过但是是windows的,linux的没找到啊😥
ipv4优先级设置完了,ping都没问题,但还是显示“127.0.0.1 已拒绝连接”,😭
ipv4优先级设置完了,ping都没问题,但还是显示“127.0.0.1 已拒绝连接”,😭
sudo netstat -tlpn看看
vim /etc/ssh/sshd_config
1.把 StrictModes
从 yes
改为 no
2.在AllowUsers
后面加上你的用户名,多个用户名之间空格隔开,最前面的deepin不用管
然后 sudo systemctl restart sshd
看看
sudo netstat -tlpn看看
显示下面的信息
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:6060 0.0.0.0:* LISTEN 1937/cpolar: master
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1676/cupsd
tcp 0 0 10.0.3.1:53 0.0.0.0:* LISTEN 1999/dnsmasq
tcp 0 0 127.0.0.1:4040 0.0.0.0:* LISTEN 2086/cpolar: worker
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1708/sshd: /usr/sbi
tcp 0 0 127.0.0.1:35600 0.0.0.0:* LISTEN 1935/ToDesk_Service
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 2127/smbd
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 2127/smbd
tcp6 0 0 ::1:631 :::* LISTEN 1676/cupsd
tcp6 0 0 :::2017 :::* LISTEN 1939/v2raya
tcp6 0 0 :::46249 :::* LISTEN 3247/dde-cooperatio
tcp6 0 0 :::9200 :::* LISTEN 2086/cpolar: worker
tcp6 0 0 :::22 :::* LISTEN 1708/sshd: /usr/sbi
tcp6 0 0 :::139 :::* LISTEN 2127/smbd
tcp6 0 0 :::445 :::* LISTEN 2127/smbd
显示下面的信息
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:6060 0.0.0.0:* LISTEN 1937/cpolar: master
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1676/cupsd
tcp 0 0 10.0.3.1:53 0.0.0.0:* LISTEN 1999/dnsmasq
tcp 0 0 127.0.0.1:4040 0.0.0.0:* LISTEN 2086/cpolar: worker
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1708/sshd: /usr/sbi
tcp 0 0 127.0.0.1:35600 0.0.0.0:* LISTEN 1935/ToDesk_Service
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 2127/smbd
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 2127/smbd
tcp6 0 0 ::1:631 :::* LISTEN 1676/cupsd
tcp6 0 0 :::2017 :::* LISTEN 1939/v2raya
tcp6 0 0 :::46249 :::* LISTEN 3247/dde-cooperatio
tcp6 0 0 :::9200 :::* LISTEN 2086/cpolar: worker
tcp6 0 0 :::22 :::* LISTEN 1708/sshd: /usr/sbi
tcp6 0 0 :::139 :::* LISTEN 2127/smbd
tcp6 0 0 :::445 :::* LISTEN 2127/smbd
sshd看上去正常启动了,ssh $USER@0 试试可以连接吗
vim /etc/ssh/sshd_config
1.把 StrictModes
从 yes
改为 no
2.在AllowUsers
后面加上你的用户名,多个用户名之间空格隔开,最前面的deepin不用管
然后 sudo systemctl restart sshd
看看
你好,按照你的方法试了下,还是访问不了啊😭
sshd看上去正常启动了,ssh $USER@0 试试可以连接吗
可以连接
admin@admin-PC:~$$USER@0
The authenticity of host '0.0.0.0 (0.0.0.0)' can't be established.
ED25519 key fingerprint is SHA256:0vxXhAPbGZHo5drVipyEsD0woliv4T/imW7THtlmc.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '0.0.0.0' (ED25519) to the list of known hosts.
[email protected]'s password:
验证成功
验证成功
Linux admin-PC 6.1.32-amd64-desktop-hwe #23.01.00.20 SMP PREEMPT_DYNAMIC Mon Sep 11 14:16:03 CST 2023 x86_64
Welcome to Deepin 23 GNU/Linux
* Homepage:https://www.deepin.org/
* Bugreport:https://bbs.deepin.org/
Popular Events
More
localhost和127.0.0.1都显示已拒绝连接
host文件、host.allow文件、hosts.allow文件都添加了映射,防火墙也都关闭了,可还是连不上,谁能帮我解决下