小编tak*_*hin的帖子

ssh:“代理承认未能使用密钥签名”

我正在尝试在 Ubuntu 服务器上使用 ssh 设置无密码登录,但我不断收到:

Agent admitted failure to sign using the key
Run Code Online (Sandbox Code Playgroud)

并提示输入密码。

我生成了新的 rsa 密钥。在系统重新启动之前,它工作得很好。

所有链接都将我引向此错误,但没有任何效果。SSH 代理仍未运行。

如何解决?也许文件需要特定的权限?

remote-access ubuntu ssh password

38
推荐指数
2
解决办法
3万
查看次数

从 bash 向 IRC 频道发送消息

我已经安装ircd-hybrid在我的 Ubuntu 服务器(192.168.1.2,example.com)上。
我们用来#teamchannel在团队内部进行交流。

现在的问题是:如何从发送一些短信example.com#teamchannel从bash脚本?例如example.com: Alert! The server is rebooting now

编辑:

我找到了一个 perl 脚本,它完全符合我的需要。

automation ubuntu bash irc

9
推荐指数
2
解决办法
1万
查看次数

lftp:如何在远程服务器上复制文件

如何使用lftp在远程服务器上复制文件?

移动文件就像使用mv命令一样简单,但是有什么命令等同于cp?

ubuntu copy ftp

8
推荐指数
3
解决办法
3万
查看次数

基于grep结果的回声

无论 grep 是否找到任何结果,我都需要一个显示“是”或“否”的衬里。

我玩过grep -c,但没有成功。

scripting bash grep

7
推荐指数
1
解决办法
8182
查看次数

欧洲域的域续订/到期日期 (whois)

如何从控制台获取有关欧洲域的域到期日期的信息,例如.eu, .de, .sk

对于.com域我只是用whois example.com,但对于欧洲的领域我得到的只是短暂的信息,没有的日期(例如,NOT DISCLOSED!用于.eu域)

作为替代解决方案,我找到了付费网络服务www.whoisxmlapi.com,但它也很有限(我正在寻找非商业项目的解决方案)。

debian domain whois

7
推荐指数
1
解决办法
3330
查看次数

子域的端口

我已经使用 apt-get 安装了 Hudson,并且 Hudson 服务器在example.com:8080.

因为example.com我使用标准端口 *:80 和一些虚拟主机这样设置:

# /etc/apache2/sites-enabled/subdomain.example.com
<Virtualhost *:80>
  ServerName subdomain.example.com
  ...
</Virtualhost>
Run Code Online (Sandbox Code Playgroud)

以下是有关哈德逊过程的信息:

/usr/bin/daemon --name=hudson --inherit --env=HUDSON_HOME=/var/lib/hudson --output=/var/log/hudson/hudson.log --pidfile=/var/run/hudson/hudson.pid -- /usr/bin/java -jar /usr/share/hudson/hudson.war --webroot=/var/run/hudson/war
  987 ?        Sl     1:08 /usr/bin/java -jar /usr/share/hudson/hudson.war --webroot=/var/run/hudson/war
Run Code Online (Sandbox Code Playgroud)

我应该如何转发:

    http:// example.com:8080  
Run Code Online (Sandbox Code Playgroud)

到:

    http:// hudson.example.com
Run Code Online (Sandbox Code Playgroud)

ubuntu port-forwarding virtualhost hudson apache-2.2

6
推荐指数
1
解决办法
8888
查看次数

如何过滤通过管道传输到 xargs 的文件列表?

我的命令:git show --pretty="format:" --name-only返回文件列表。然后我使用 xargs 对这些文件运行 shell 脚本:

git show --pretty="format:" --name-only  | xargs -i phpmd $dir/'{}' text codesize,unusedcode,naming
Run Code Online (Sandbox Code Playgroud)

但是,我想仅对具有.php扩展名的文件运行该 xargs 命令。如何过滤不需要的文件?

scripting bash

4
推荐指数
1
解决办法
3352
查看次数

cd + bash补全脚本

我有网络项目/var/www/projects/some/long/path/strange-project-name

现在我想在终端输入:

webs str{TAB}
Run Code Online (Sandbox Code Playgroud)

它应该自动完成webs strange-project-name(基于ls /var/www/projects/some/long/path/),并且在执行命令后,pwd应该指向项目路径。cd strange-project-name自动完成功能有点智能

您将如何实现此功能?一些智能别名?函数在.bashrc? 脚本?

一些智能别名?

ubuntu bash command-line-interface

1
推荐指数
1
解决办法
1092
查看次数

如何在没有第一行的情况下显示结果

当我运行一些 bash 命令时,它返回2..n文本行(n每次都不同,可能包含空行)。

如何过滤输出以显示跳过第 1 行和第 2 行的结果?

例如

$ my_command

file1
file2
file3
file3

$ my_command | some_filter

file3
file4
Run Code Online (Sandbox Code Playgroud)

ubuntu bash text grep pipe

0
推荐指数
1
解决办法
177
查看次数