加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – 是否有可能将ssh或rsync引入其文件系统已将其自身重新

发布时间:2020-12-14 02:47:11 所属栏目:Linux 来源:网络整理
导读:我需要登录进入只读状态的系统.我可以ping它就好了,但我不能再ssh了.是否有一些特殊的命令行标志/参数我可以通过ssh,让我登录进入只读模式的系统? 忘了添加确切的连接错误: OpenSSH_5.3p1,OpenSSL 1.0.1e-fips 11 Feb 2013debug1: Reading configuration d
我需要登录进入只读状态的系统.我可以ping它就好了,但我不能再ssh了.是否有一些特殊的命令行标志/参数我可以通过ssh,让我登录进入只读模式的系统?

忘了添加确切的连接错误:

OpenSSH_5.3p1,OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 192.168.0.4 [192.168.0.4] port 22.
debug1: Connection established.
debug1: identity file /home/username/.ssh/identity type -1
debug1: identity file /home/username/.ssh/identity-cert type -1
debug1: identity file /home/username/.ssh/id_rsa type -1
debug1: identity file /home/username/.ssh/id_rsa-cert type -1
debug1: identity file /home/username/.ssh/id_dsa type -1
debug1: identity file /home/username/.ssh/id_dsa-cert type -1
ssh_exchange_identification: Connection closed by remote host

我应该补充一点,ping对于那个盒子非常健壮:

ping 192.168.0.4
PING 192.168.0.4 (192.168.0.4) 56(84) bytes of data.
64 bytes from 192.168.0.4: icmp_seq=1 ttl=64 time=0.662 ms
64 bytes from 192.168.0.4: icmp_seq=2 ttl=64 time=0.088 ms
64 bytes from 192.168.0.4: icmp_seq=3 ttl=64 time=0.089 ms

解决方法

您可以通过调用无登录shell会话来登录.例如,您可以在成功进行身份验证后将命令传递给ssh:
ssh user@host bash --noprofile --norc

当然,这使用bash作为shell.不同的shell将需要适当的参数,以便不触发wtmp / utmp更新,以及不尝试做可能失败的事情并提前注销(即,在shell通常打开登录时完成其常规任务之前会话).

警告提示:shell会相当(非常!)有限,通常没有提示和其他幻想.但这足以让你进入机器并检查出了什么问题.

编辑添加:根据主机的具体情况,可能需要指定完整路径,例如/ bin / bash作为成功进行身份验证时执行的命令.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读