排查sshfs挂载失败的问题
排查sshfs挂载失败的问题
写代码在Linux上运行,但是熟悉的IDE(比如VS code)在自己的电脑上,可以使用sshfs把linux上的目录挂载到本地,再用VScode打开即可,可以使用下面的命令:
sshfs -odebug,sshfs_debug,loglevel=debug -o rw,allow_other,uid=1190,gid=1190,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,IdentityFile=/Users/harlanc/.privateKey harlanc@192.168.23.2:/data1/workspace/mount/ffmpeg /Users/harlanc/workspace_ffmpeg
但是今天碰到一个问题,在别的CentOS机器上没问题,但是到192.168.23.2这台机器却连不上,报如下错误:
SSHFS version 2.5
FUSE library version: 2.9.9
nullpath_ok: 0
nopath: 0
utime_omit_ok: 0
executing <ssh> <-x> <-a> <-oClearAllForwardings=yes> <-ologlevel=debug> <-oServerAliveInterval=15> <-oServerAliveCountMax=3> <-oIdentityFile=/Users/ harlanc/.privateKey> <-2> <harlanc@192.168.23.2> <-s> <sftp>
debug1: Reading configuration data /Users/harlanc/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to 192.168.23.2 [192.168.23.2] port 22.
debug1: Connection established.
debug1: identity file /Users/harlanc/.privateKey type -1
debug1: identity file /Users/harlanc/.privateKey-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_9.8
kex_exchange_identification: read: Connection reset by peer
Connection reset by 192.168.23.2 port 22
remote host has disconnected
服务端主动断开链接了,查看服务端的ssh服务:
[root@harlanc]# netstat -nltp | grep sshd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1085/sshd
tcp6 0 0 :::22 :::* LISTEN 1085/sshd
在查看一下ssh进程的具体信息:
[root@ harlanc]# ps -ef | grep 1085
root 1085 1 0 15:39 ? 00:00:00 /usr/local/sbin/sshd -D
[root@ harlanc]# rpm -qf /usr/local/sbin/sshd
***openssh-6.7.x86_64 //这里***是我们公司的名字
原来用的是我们公司自己的ssh服务。
而在可以连上的CentOS机器上,使用的是openssh这个开源ssh服务,把我们的服务替换成openssh不太现实,可以把openssh服务换一个端口启动起来:
vim /etc/ssh/sshd_config
找到
Port 22
替换成
Port 23
把openssh启动起来:
[root@ harlanc]# systemctl start sshd
这下两个服务都起来了:
[root@ harlanc]# netstat -nltp | grep sshd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1085/sshd
tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN 316299/sshd
tcp6 0 0 :::22 :::* LISTEN 1085/sshd
tcp6 0 0 :::23 :::* LISTEN 316299/sshd
使用sshfs挂载的时候指定一下端口:
sshfs -p 23 -odebug,sshfs_debug,loglevel=debug -o rw,allow_other,uid=1190,gid=1190,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,IdentityFile=/Users/harlanc/.privateKey harlanc@192.168.23.2:/data1/workspace/mount/ffmpeg /Users/harlanc/workspace_ffmpeg
最后终于挂载上了。
harlanc@APB ~ % df -h
Filesystem Size Used Avail Capacity iused ifree %iused
harlanc@192.168.23.2:/data1/workspace/mount/ffmpeg 295Gi 237Gi 58Gi 81% 1.4M 18M 7% /Users/harlanc/workspace_ffmpeg
排查sshfs挂载失败的问题的更多相关文章
- nfs文件系统挂载失败解决方法
nfs文件系统挂载失败解决方法 */--> nfs文件系统挂载失败解决方法 Table of Contents 1. 错误提示 2. 我的配置 1 错误提示 bootserver=255.255 ...
- windows通过sshfs挂载linux目录
之前讲过一种方法,PC跟VM在同局域网的情况下,可以用samba的方式挂载linux系统的目录到windows上.但是当PC跟VM不同局域网时这种方式就没办法了. 网络环境 在示意图中,PC只能直连物 ...
- 使用sshfs挂载远程服务器目录
点击访问原文 您还可以加入全栈技术交流群(QQ群号:254842154) 服务器日志查看,是开发人员和服务器运维人员在工作中经常会遇到的一件事情,只有一台服务器时,比较好办,直接登录服务器使用tail ...
- 使用 SSHFS 挂载远程的 Linux 文件系统及目录
1. 安装 sudo apt-get install sshfs 2. 创建 SSHFS 挂载目录 sudo mkdir /mnt/cong 3.使用 SSHFS 挂载远程的文件系统 sudo ssh ...
- windows下sshfs挂载远程文件夹-server could not connect故障解决
使用sshfs挂载server上面的文件夹到windows中.轻松方便. 在之前的系统上挂载.没出问题. 近期买了块固态硬盘.装了个系统. 结果在系统上执行sshfs时报例如以下错误: 事实上非常ea ...
- Linux安装sshfs挂载远程目录到本地及卸载
挂载远程目录的方式很多,这里把sshfs记录一下备忘.Linux用sshfs挂载远程目录到本地 安装sshfs 在Ubuntu下,只需要使用 $ sudo apt-get install sshfs ...
- U盘安装Ubuntu Server CD-ROM挂载失败
U盘安装 Ubuntu Server 发生Failed to copy file from CD-ROM问题 使用UltraISO制作Ubuntu Server安装盘,在安装过程中出现[!!] Loa ...
- Linux嵌入式学习-mount命令+nfs挂载失败原因【转】
NFS 挂载失败原因[待搜集] 1.挂载时若出现mount.nfs: Input/output error 解决:在客户端也需启动portmap服务 service portmap status[查看 ...
- Ubuntu下使用sshfs挂载远程目录到本地(和Windows挂载盘一样)
访问局域网中其他Ubuntu机器,在不同机器间跳来跳去,很是麻烦,如果能够把远程目录映射到本地无疑会大大方面使用,就像Windows下的网络映射盘一样.在Linux的世界无疑也会有这种机制和方式,最近 ...
- Linux使用sshfs挂载远程目录到本地
1安装sshfs [root@iZwz9hy7gff0kpg1swp1d3Z ~]# yum install sshfs 2创建本地目录 [root@iZwz9hy7gff0kpg1swp1d3Z ~ ...
随机推荐
- Springboot + Vue ElementUI 实现MySQL可视化
一.功能展示: 效果如图: DB连接配置维护: Schema功能:集成Screw生成文档,导出库的表结构,导出表结构和数据 表对象操作:翻页查询,查看创建SQL,生成代码 可以单个代码文件下载,也 ...
- 【Vue】未读消息标记功能
页面展示的效果如图,需要定时更新未读消息 首先是后台的接口,查询未处理的消息数量 因为是七张消息表,数据我需要合在一起返回给前台: 这里使用UNION连接各个表 SELECT COUNT(*) AS ...
- 【转载】 CNN训练Cifar-10技巧
原文地址: https://www.cnblogs.com/neopenx/p/4480701.html ====================================== 关于数据集 Ci ...
- 工作站CPU超频,通过测试软件的压力测试就OK了吗?终极测试还是要看具体的应用场景
最近想起超频试试自己年初入手的工作站,也是纯玩,超超频,看看是什么个体验,不过这个过程中还真有所学习. 由于电脑的主板,电源,散热等配的都比较高端,所以上来直接超频5.2G,电压选择为自动,不过再整个 ...
- Illegal key size or default parameters 解决方案
1.背景 在做aes加密时,报错 Illegal key size or default parameters...有的jdk版本报错,有的不报错,原因在于: jdk 或jre\lib\securit ...
- Apache DolphinScheduler 社区 3 月月报
各位热爱 DolphinScheduler 的小伙伴们,DolphinScheduler 社区月报开始更新啦!这里将记录 DolphinScheduler 社区每月的重要更新. 社区为 Dolphin ...
- sqlserver 索引优化 CPU占用过高 执行分析 服务器检查[转]
SELECT TOP 10 [Total Cost] = ROUND(avg_total_user_cost * avg_user_impact * (user_seeks + user_scans) ...
- dsu on tree 模板
dsu on tree模板运用 例题以及代码: U41492 树上数颜色 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 记录详情 - 洛谷 | 计算机科学教育新生态 (luogu. ...
- AWG(American wire gauge)美国线规
AWG(American wire gauge)美国线规,是一种区分导线直径的标准,又被称为 Brown & Sharpe线规.这种标准化线规系统于1857年起在美国开始使用.AWG前面的数值 ...
- 最新AI生成视频工具!效果不输快手可灵,CogVideoX下载介绍
要说AI生成视频最火的项目,当属国产的快手可灵了,甚至比OpenAI的Sora还要火,前者还是个ppt,可灵已经在落地公测了,博主在前段时间申请试用通道的时候,竟然排到几十万人开外的位置,好在最后还是 ...