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

我需要登录进入只读状态的系统.我可以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作为成功进行身份验证时执行的命令.

相关文章

查找全部容器的日志文件 $ sudo find /var/lib/docker/conta...
Linux日志文件中列属性的详细解析
在Linux系统中没有duf命令,如何有效地管理磁盘空间?
深入探讨EncryptPad在Linux操作系统中的功能和优势
原理和应用场景:Linux中ttyload工具的工作原理和实际用途
深度解析SELinux的三种策略类型