【问题标题】:delete remote file using ssh when ssh not working当 ssh 不工作时使用 ssh 删除远程文件
【发布时间】:2014-11-21 22:09:18
【问题描述】:

在远程服务器上,我在 /etc/profile.d/x.sh 中创建了一个包含内容的文件

#!/bin/bash

exit 1

现在我无法通过 ssh 连接到远程服务器。不幸的是,SSH 是唯一的连接方式。

ssh root@remoteserver
Password:
Last login: Fri Nov 21 18:32:47 2014 from 10.62.95.12
Connection to remoteserver closed.

我试过了

ssh root@10.62.95.130 rm -f /etc/profile.d/x.sh
Password:

但这不起作用。有什么方法可以使用 ssh 删除文件。或者指示 ssh 在出错时继续。

【问题讨论】:

    标签: linux ssh


    【解决方案1】:

    试试——ssh root@server sh 然后rm /etc/profile.d/x.sh

    虽然ssh root@server rm /etc/profile.d/x.sh 也适合我。

    【讨论】:

      猜你喜欢
      • 2023-03-23
      • 2014-09-29
      • 2015-01-23
      • 2023-02-19
      • 2010-09-24
      • 2017-07-04
      • 1970-01-01
      • 2014-09-28
      • 1970-01-01
      相关资源
      最近更新 更多