电子商务网站的优点有那些,查看域名之前做的网站,太原网站优化哪家专业,中小企业网站建设案例#排查sshfs挂载失败的问题
写代码在Linux上运行#xff0c;但是熟悉的IDE#xff08;比如VS code#xff09;在自己的电脑上#xff0c;可以使用sshfs把linux上的目录挂载到本地#xff0c;再用VScode打开即可#xff0c;可以使用下面的命令#xff1a;
sshfs -odebug…#排查sshfs挂载失败的问题
写代码在Linux上运行但是熟悉的IDE比如VS code在自己的电脑上可以使用sshfs把linux上的目录挂载到本地再用VScode打开即可可以使用下面的命令
sshfs -odebug,sshfs_debug,logleveldebug -o rw,allow_other,uid1190,gid1190,reconnect,ServerAliveInterval15,ServerAliveCountMax3,IdentityFile/Users/harlanc/.privateKey harlanc192.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 -oClearAllForwardingsyes -ologleveldebug -oServerAliveInterval15 -oServerAliveCountMax3 -oIdentityFile/Users/ harlanc/.privateKey -2 harlanc192.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服务
[rootharlanc]# 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,logleveldebug -o rw,allow_other,uid1190,gid1190,reconnect,ServerAliveInterval15,ServerAliveCountMax3,IdentityFile/Users/harlanc/.privateKey harlanc192.168.23.2:/data1/workspace/mount/ffmpeg /Users/harlanc/workspace_ffmpeg最后终于挂载上了。 harlancAPB ~ % df -h
Filesystem Size Used Avail Capacity iused ifree %iused
harlanc192.168.23.2:/data1/workspace/mount/ffmpeg 295Gi 237Gi 58Gi 81% 1.4M 18M 7% /Users/harlanc/workspace_ffmpeg