ssh: connect to host xxx.xxx.xxx.xxx port 22: Connection refused
工具/原料:Ubuntu
在采用scp在不同机器之间进行文件拷贝时出现标题所示的错误,原因可能是:
1.sshd 未启动
2.sshd 未安装
3.防火墙
4需重新启动ssh 服务
查看sshd进程方式:ps -e | grep ssh,如果类似如下
14688 ? 00:00:00 ssh-agent
24647 pts/2 00:00:00 ssh
没有sshd,则说明sshd未启动,尝试启动:
service sshd restart(需要root权限)
如果出现:
Failed to restart ssh.service: Unit ssh.service not found.
说明sshd未安装,或者通过查看/etc/init.d/目录下是否有ssh,若没有则说明需要安装sshd.
安装sshd:
sudo apt-get install openssh-server
安装完成后ps -e | grep ssh查看是否启动。
注意:安装完后,查看/etc/ssh/sshd_config中是否有"PermitRootLoginwithout-password“这一项,若有加#注释掉,然后增加一句"PermitRootLogin yes",保存退出即可。
如果sshd已经安装,且也已经启动,但还是连接不上,试着重启ssh
service ssh restart
若还是不行,那就可能是防火墙的问题了,关闭防火墙
sudo ufw disable
然后检查是否能够连接成功
ssh localhost
出现
The authenticity of host 'localhost (127.0.0.1)' can't be established.
ECDSA key fingerprint is SHA256:wCcI3OLsC4FcUDhMmuJZ3WLf4uK0BMphJaRkFIo/zqg.
Are you sure you want to continue connecting (yes/no)?
说明连接成功。
ssh: connect to host xxx.xxx.xxx.xxx port 22: Connection refused的更多相关文章
- 阿里云配置通用服务的坑 ssh: connect to host 47.103.101.102 port 22: Connection refused
1.~ wjw$ ssh root@47.103.101.102 ssh: connect to host 47.103.101.102 port 22: Connection refused ssh ...
- ssh: connect to host 192.168.11.180 port 22: Connection refused
错误原因: 1.sshd 未安装:sudo apt-get install openssh-server 2.sshd 未启动:sudo net start sshd 3.防火墙:sudo ufw d ...
- ssh: connect to host 120.79.26.164 port 22: Connection timed out报错问题
要是使用阿里云服务器,出现这种错误,一般是端口没有打开.需要在阿里云控制台中设置端口后,即可使用ssh连接.
- scp出现ssh port 22: Connection refused 问题解决具体步骤
[root(0)@sys11 09:20:29 /home/work/Code_release/bj]# scp ./release.sh root@192.168.161.151:/Users/a ...
- ssh: connect to host github.com port 22: Connection refused
假设git例如,下面的问题时,远程推送: [fulinux@ubuntu learngit]$ git push -u origin master ssh: connect to host githu ...
- Ubuntu下 ssh : connect to host localhost port 22:Connection refused
Ubuntu下测试ssh时使用ssh localhost 命令,出现错误提示connect to host localhost port 22:Connection refused 造成这个错误的原因 ...
- scp ssh: connect to host 9.123.159.41 port 22:connection refused的解决办法
不同机器之间的文件拷贝,可以用scp命令 使用时报:ssh:connect to host 192.16.41.121 port 22:connectionrefused mac 无法ssh loca ...
- 运行Hadoop start-all.sh遇到的错误ssh: connect to host localhost port 22: Connection refused
ssh: connect to host localhost port 22: Connection refused 我的情况是ssh server没装,查看方法: ps -e |grep ssh 1 ...
- ssh: connect to host localhost port 22: Connection refused
1.hadoop安装好之后,执行ssh localhost无法执行, 提示“ssh: connect to host localhost port 22: Connection refused”. 2 ...
- 新手git: ssh: connect to host localhost port 22: Connection refused
由于gitlab上要git pull或者git clone,可是每次都出现这个问题.之前偶尔出现这个问题.可是仅仅是偶尔.这是为什么呢?然后就開始搜索网上的解决方式了. 这个问题搜索网上非常多答案.可 ...
随机推荐
- 使用纯代码定义UICollectionView和自定义UICollectionViewCell
1.自定义UICollectionView 2.实现<UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,UICollec ...
- 【转】/etc/grub.conf文件详解
转自:http://leejia.blog.51cto.com/4356849/788902 grub.conf是grub的主配置文件,通过这个配置文件,grub才能找到kernel,系统才能正常启动 ...
- IE下载打印文件的时候,下载打印闪一下就没有了
这是因为我们的浏览器没有将文件下载的自动提示设为启用.点击IE菜单栏中的“工具”—“Internet选项”-安全—可信站点—自定义级别 1,添加信任站点 打开IE浏览器,输入需要下载文件的地址 选择[ ...
- C#/Access-数据库获取自动编号的最大值
//conStrSQL你改成你的access,我这里用的SQL2005string conStrSQL = "Data Source=xx.xx.xx.xx;Initial Catalog= ...
- ZOJ 3829 Known Notation 贪心
Known Notation Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.zju.edu.cn/onlinejudge/showPro ...
- 一步一步写算法(之hash表)
[ 声明:版权全部,欢迎转载,请勿用于商业用途. 联系信箱:feixiaoxing @163.com] hash表,有时候也被称为散列表.个人觉得,hash表是介于链表和二叉树之间的一种中间结构.链 ...
- Ubuntu下配置 keepalived+nginx+tomcat 负载均衡
本文力图阐述在 Ubuntu Server 环境下使用 Keepalived + Nginx + Tomcat 搭建高可用负载均衡环境的操作步骤和简约配置,这里不涉及性能调优.先说一下他们各自扮演的角 ...
- 【Android】Activity遮罩效果的实现
Activity文件 package com.app.test02; import android.app.Activity; import android.graphics.Color; impor ...
- iOS开发——面试笔试精华(三)
面试笔试精华(三) 1. When to use NSMutableArray and when to use NSArray? 什么时候使用NSMutableArray,什么时候使用N ...
- 会话跟踪session cookie
会话跟踪 会话(Session)跟踪是Web程序中常用的技术,用来跟踪用户的整个会话.常用的会话跟踪技术Cookie与Session.Cookie通过在客户端记录信息确定用户身份,Session通过在 ...