排查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挂载失败的问题的更多相关文章

  1. nfs文件系统挂载失败解决方法

    nfs文件系统挂载失败解决方法 */--> nfs文件系统挂载失败解决方法 Table of Contents 1. 错误提示 2. 我的配置 1 错误提示 bootserver=255.255 ...

  2. windows通过sshfs挂载linux目录

    之前讲过一种方法,PC跟VM在同局域网的情况下,可以用samba的方式挂载linux系统的目录到windows上.但是当PC跟VM不同局域网时这种方式就没办法了. 网络环境 在示意图中,PC只能直连物 ...

  3. 使用sshfs挂载远程服务器目录

    点击访问原文 您还可以加入全栈技术交流群(QQ群号:254842154) 服务器日志查看,是开发人员和服务器运维人员在工作中经常会遇到的一件事情,只有一台服务器时,比较好办,直接登录服务器使用tail ...

  4. 使用 SSHFS 挂载远程的 Linux 文件系统及目录

    1. 安装 sudo apt-get install sshfs 2. 创建 SSHFS 挂载目录 sudo mkdir /mnt/cong 3.使用 SSHFS 挂载远程的文件系统 sudo ssh ...

  5. windows下sshfs挂载远程文件夹-server could not connect故障解决

    使用sshfs挂载server上面的文件夹到windows中.轻松方便. 在之前的系统上挂载.没出问题. 近期买了块固态硬盘.装了个系统. 结果在系统上执行sshfs时报例如以下错误: 事实上非常ea ...

  6. Linux安装sshfs挂载远程目录到本地及卸载

    挂载远程目录的方式很多,这里把sshfs记录一下备忘.Linux用sshfs挂载远程目录到本地 安装sshfs 在Ubuntu下,只需要使用 $ sudo apt-get install sshfs ...

  7. U盘安装Ubuntu Server CD-ROM挂载失败

    U盘安装 Ubuntu Server 发生Failed to copy file from CD-ROM问题 使用UltraISO制作Ubuntu Server安装盘,在安装过程中出现[!!] Loa ...

  8. Linux嵌入式学习-mount命令+nfs挂载失败原因【转】

    NFS 挂载失败原因[待搜集] 1.挂载时若出现mount.nfs: Input/output error 解决:在客户端也需启动portmap服务 service portmap status[查看 ...

  9. Ubuntu下使用sshfs挂载远程目录到本地(和Windows挂载盘一样)

    访问局域网中其他Ubuntu机器,在不同机器间跳来跳去,很是麻烦,如果能够把远程目录映射到本地无疑会大大方面使用,就像Windows下的网络映射盘一样.在Linux的世界无疑也会有这种机制和方式,最近 ...

  10. Linux使用sshfs挂载远程目录到本地

    1安装sshfs [root@iZwz9hy7gff0kpg1swp1d3Z ~]# yum install sshfs 2创建本地目录 [root@iZwz9hy7gff0kpg1swp1d3Z ~ ...

随机推荐

  1. JavaWeb入门到实战学习笔记

    了解,讲得并不是很好,很展开. 概念 动态web Web服务器 web服务器这节也是蜻蜓点水,引出tomcat而已 ASP(C#语言,微软) JSP PHP Java bootstrapclasslo ...

  2. 华为超算平台git、cmake、wget、curl报错:SSLv3_client_method version OPENSSL_1_1_0 not defined in file libssl.so.1.1 with link time reference——解决方法

    最近在使用超算平台时报错,不管是git.cmake.wget.curl中的哪个都报错,大致错误: /usr/bin/cmake3: relocation error: /usr/lib64/libcu ...

  3. 树莓派命令行配置wifi密码时如何实现密码加密(密文,非明文)

    首先需要知道,树莓派系统(原生系统)的wifi配置文件为: /etc/wpa_supplicant/wpa_supplicant.conf 配置该文件时,psk属性为密码,往往我们都是使用明文来进行配 ...

  4. 使用 Apache DolphinScheduler 进行 EMR 任务调度

    By AWS Team 前言 随着企业规模的扩大,业务数据的激增,我们会使用 Hadoop/Spark 框架来处理大量数据的 ETL/聚合分析作业,⽽这些作业将需要由统一的作业调度平台去定时调度. 在 ...

  5. SMU Summer 2024 Contest Round 7

    SMU Summer 2024 Contest Round 7 Make Equal With Mod 题意 给定一个长度为 \(n\) 的数列 \(a\).你可以执行若干次操作,每次操作选择一个大于 ...

  6. java_可变参数&增强for循环

    代码比较无厘头,记录看懂的意思 在可变参数的构造方法中,需要使用增强for循环遍历 public class name { String sex; public static void main(St ...

  7. OpenVino快速落地部署教程

    OpenVino快速落地部署教程 Openvino是由Intel开发的专门用于优化和部署人工智能推理的半开源的工具包,主要用于对深度推理做优化.本教程适用于Yolov5-7.0,直接跑Yolov5为6 ...

  8. Ubuntu 配置默认编辑器

    在 Ubuntu 系统中,可以通过多种方式配置默认的文本编辑器,以便在使用命令行工具(如 crontab 或 visudo)时自动使用你喜欢的编辑器.以下是几种常见的方法: 使用 update-alt ...

  9. containerd:配置https私有镜像仓库的最新方法

    随着containerd应用越来越广泛,我们必须紧跟官网的节奏. 之前配置https私有镜像仓库的方法比较繁琐,并且不易梳理,下边介绍一下目前最新的配置方法. 配置https私有镜像仓库 我假设你现在 ...

  10. c++学习笔记(一):内存分区模型

    目录 内存分区模型 程序运行前 程序运行后 new操作符 内存分区模型 c++在执行时,将内存大方向划分为4个区域 代码区:存放函数体的二进制代码,由操作系统进行管理(编写的所有代码都会存放到该处) ...