linux - 错误 : Can't open display: (null) when using

我正在关注 Generating SSH Keys ,它说

sudo apt-get install xclip

下载并安装 xclip。如果您没有 apt-get ,您可能需要使用其他安装程序(如 yum)

xclip -sel clip < ~/.ssh/id_rsa.pub

将 id_rsa.pub 文件的内容复制到剪贴板

但是在我运行 xclip -sel clip < ~/.ssh/id_rsa.pub 之后我得到 Error: Can't open display: (null) 问题是什么?我用谷歌搜索了一下,但什么也没找到

最佳答案

DISPLAY=:0 xclip -sel clip < ~/.ssh/id_rsa.pub对我不起作用(ubuntu 14.04),但您可以使用:

cat ~/.ssh/id_rsa.pub

获取你的公钥

关于linux - 错误 : Can't open display: (null) when using Xclip to copy ssh public key,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18695934/

相关文章:

python - 使用字典计算列表中的项目

python - 定义Python源代码编码的正确方法

python - 是否可以将已编译的 .pyc 文件反编译为 .py 文件?

python - 为什么 (1 in [1,0] == True) 评估为 False?

linux - 安装 Jenkins 后无法 su 到用户 jenkins

linux - 如何通过命令行将图像转换为灰度?

c - 如何设置 cron 作业以每小时运行一次可执行文件?

linux - 并排显示两个文件

python - 将字符串打印为十六进制字节

python - 在pytest中,conftest.py文件有什么用?