当前位置:网站首页>port 22: Connection refused
port 22: Connection refused
2022-06-24 09:49:00 【yitahutu79】
Prompt connection failure when setting password free login
[[email protected] .ssh]$ ssh-copy-id [email protected]
/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/bin/ssh-copy-id: ERROR: ssh: connect to host 192.168.145.129 port 22: Connection refused
see 22 Is port number on ss -lnt , The result is not turned on
[email protected] .ssh % ss -lnt [0]
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:*
LISTEN 0 5 127.0.0.1:631 0.0.0.0:*
LISTEN 0 5 [::1]:631 [::]:*
[email protected] .ssh % lsof -i:22 [0]
Aware that it may be SSH The service is not installed so download and install sudo apt-get install openssh-server openssh-client
[email protected] .ssh % sudo apt-get install openssh-server openssh-client
[sudo] lj Password :
Reading package list ... complete
Analyzing package dependency tree
Reading status information ... complete
openssh-client It's the latest edition (1:8.2p1-4ubuntu0.5).
openssh-client Set to manual installation .
The following packages are installed automatically and are no longer needed :
libfprint-2-tod1 libfwupdplugin1 libllvm10
Use 'sudo apt autoremove' To uninstall it ( they ).
The following software will be installed at the same time :
ncurses-term openssh-sftp-server ssh-import-id
Proposed installation :
molly-guard monkeysphere ssh-askpass
The following 【 new 】 The package will be installed :
ncurses-term openssh-server openssh-sftp-server ssh-import-id
The upgrade 0 Software package , New installation 4 Software package , To uninstall 0 Software package , Yes 9 Packages not upgraded .
Need to download 688 kB The filing of .
After decompression, it will consume 6,010 kB Extra space .
Would you like to continue ? [Y/n] y
obtain :1 http://ftp.sjtu.edu.cn/ubuntu focal/main amd64 ncurses-term all 6.2-0ubuntu2 [249 kB]
obtain :2 http://ftp.sjtu.edu.cn/ubuntu focal-updates/main amd64 openssh-sftp-server amd64 1:8.2p1-4ubuntu0.5 [51.5 kB]
obtain :3 http://ftp.sjtu.edu.cn/ubuntu focal-updates/main amd64 openssh-server amd64 1:8.2p1-4ubuntu0.5 [377 kB]
obtain :4 http://ftp.sjtu.edu.cn/ubuntu focal/main amd64 ssh-import-id all 5.10-0ubuntu1 [10.0 kB]
Downloaded 688 kB, Time consuming 10 second (65.5 kB/s)
Presetting package ...
Selecting unselected packages ncurses-term.
( Reading database ... The system currently has 170245 Two files and directories .)
Ready to unzip .../ncurses-term_6.2-0ubuntu2_all.deb ...
Decompressing ncurses-term (6.2-0ubuntu2) ...
Selecting unselected packages openssh-sftp-server.
Ready to unzip .../openssh-sftp-server_1%3a8.2p1-4ubuntu0.5_amd64.deb ...
Decompressing openssh-sftp-server (1:8.2p1-4ubuntu0.5) ...
Selecting unselected packages openssh-server.
Ready to unzip .../openssh-server_1%3a8.2p1-4ubuntu0.5_amd64.deb ...
Decompressing openssh-server (1:8.2p1-4ubuntu0.5) ...
Selecting unselected packages ssh-import-id.
Ready to unzip .../ssh-import-id_5.10-0ubuntu1_all.deb ...
Decompressing ssh-import-id (5.10-0ubuntu1) ...
Setting up openssh-sftp-server (1:8.2p1-4ubuntu0.5) ...
Setting up openssh-server (1:8.2p1-4ubuntu0.5) ...
Creating config file /etc/ssh/sshd_config with new version
Creating SSH2 RSA key; this may take some time ...
3072 SHA256:1j46TJASEI//oOKLmgAcI8vQnJWxZHemllI/kqPXkEc [email protected] (RSA)
Creating SSH2 ECDSA key; this may take some time ...
256 SHA256:l6Stjl1ZVKPuTmvFA6uLMEeaaUHjR9Dx4xPDLWFqzVQ [email protected] (ECDSA)
Creating SSH2 ED25519 key; this may take some time ...
256 SHA256:7h0kKmUYhxTP65ZEIdrAWGCxZb7x5tWXPdFR4tWJ6/w [email protected] (ED25519)
Created symlink /etc/systemd/system/sshd.service → /lib/systemd/system/ssh.service.
Created symlink /etc/systemd/system/multi-user.target.wants/ssh.service → /lib/systemd/system/ssh.service.
rescue-ssh.target is a disabled or a static unit, not starting it.
Setting up ssh-import-id (5.10-0ubuntu1) ...
Attempting to convert /etc/ssh/ssh_import_id
Setting up ncurses-term (6.2-0ubuntu2) ...
Processing for systemd (245.4-4ubuntu3.17) The trigger of ...
Processing for man-db (2.9.1-1) The trigger of ...
Processing for ufw (0.36-6ubuntu1) The trigger of ...
Check again , After installation 22 The port has been opened
[email protected] .ssh % lsof -i:22 [0]
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ssh 11870 lj 3u IPv4 137835 0t0 TCP ubuntu:50830->ubuntu:ssh (ESTABLISHED)
[email protected] .ssh % ss -lnt [0]
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:*
LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
LISTEN 0 5 127.0.0.1:631 0.0.0.0:*
LISTEN 0 128 [::]:22 [::]:*
LISTEN 0 5 [::1]:631 [::]:*
Run again , success
[[email protected] ~]$ ssh-copy-id [email protected]
/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/lj/.ssh/id_rsa.pub"
/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/bin/ssh-copy-id: WARNING: All keys were skipped because they already exist on the remote system.
(if you think this is a mistake, you may want to use -f option)
边栏推荐
- 请问有国内靠谱低手续费的期货开户渠道吗?网上开户安全吗?
- Event registration Apache pulsar x kubesphere online meetup hot registration
- 【Eureka注册中心】
- 20、 Processor scheduling (RR time slice rotation, mlfq multi-level feedback queue, CFS fully fair scheduler, priority reversal; multiprocessor scheduling)
- Oracle的tnsnames.ora文件配置
- ThinkPHP5多语言切换项目实战
- PostgreSQL DBA快速入门-通过源码编译安装
- 2021-08-17
- Endgame P.O.O
- Seekbar with text: customize progressdrawable/thumb: solve incomplete display
猜你喜欢

Handling method of Oracle data file header SCN inconsistency

Grpc local test joint debugging tool bloomrpc

vim的使用

如何解决独立站多渠道客户沟通难题?这款跨境电商插件一定要知道!

PTA猴子选大王(约瑟夫环问题)

顶刊TPAMI 2022!基于不同数据模态的行为识别:最新综述

Why is LNX of e equal to X

二十、处理器调度(RR时间片轮转,MLFQ多级反馈队列,CFS完全公平调度器,优先级翻转;多处理器调度)

Talking about the knowledge of digital transformation

使用Live Chat促进业务销售的惊人技巧
随机推荐
GeoGebra 实例 时钟
NLP-D59-nlp比赛D28—我想,也好—阶段总结—心态调整
198. house raiding
ORA-16038 ORA-19502 ORA-00312故障处理
请问有国内靠谱低手续费的期货开户渠道吗?网上开户安全吗?
LeetCode: 137. Number II that appears only once
Longest public prefix of leetcode
Oracle查看数据文件头SCN信息
Niuke network decimal integer to hexadecimal string
Netrca: an effective network fault cause localization
[Eureka registry]
【自定义Endpoint 及实现原理】
When should gridfs be used?
el-table表格的拖拽 sortablejs
记录一下MySql update会锁定哪些范围的数据
Codeforces Round #392 (Div. 2) D. Ability To Convert
观察者模式
Grpc local test joint debugging tool bloomrpc
Endgame P.O.O
An open source monitoring data collector that can monitor everything