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作为成功进行身份验证时执行的命令.

相关文章

/etc/sysctl.conf这个目录主要是配置一些系统信息,/etc/sys...
1.作用 useradd或adduser命令用来建立用户帐号和创建用户的起...
它们都是多模式编辑器,不同的是vim 是vi的升级版本,它不仅...
不管是我们在安装软件还是监测软件的使用性能,我们都要随时...
装好Tomcat7后,发现除了本机能访问外界访问不了,岂有此理。...
修改防火墙配置需要修改 /etc/sysconfig/iptables 这个文件,...