【问题标题】:getting permission denied while creating SSH在创建 SSH 时获得权限被拒绝
【发布时间】:2015-05-30 04:20:41
【问题描述】:
[sneha@localhost ~]$  ssh-keygen -t rsa -C "sneha.22.7@gmail.com"

Generating public/private rsa key pair.
Enter file in which to save the key (/home/sneha/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/sneha/.ssh/id_rsa.
Your public key has been saved in /home/sneha/.ssh/id_rsa.pub.
The key fingerprint is:
c8:50:db:0d:eb:cc:23:b3:8a:90:6c:32:80:e8:e2:cc sneha.22.7@gmail.com
The key's randomart image is:

+--[ RSA 2048]----+
|      . .        |
|     . o +       |
|    . . o .      |
|o    o =         |
|+     = S        |
|+.     + .       |
|*+    .          |
|Bo . .           |
| E. .            |
+-----------------+

[sneha@localhost ~]$ /home/sneha/.ssh/id_rsa.pub
bash: /home/sneha/.ssh/id_rsa.pub: Permission denied

谁能帮忙?我很确定我正在做所有需要的事情

【问题讨论】:

    标签: ssh


    【解决方案1】:

    id_rsa.pub 不是可执行文件,它是公钥。尝试运行常规文件会给您一个权限被拒绝错误。你想做什么?通常,您会将该文件附加到您要连接到的服务器上的~/.ssh/authorized_keys

    【讨论】:

      【解决方案2】:

      原因可能是 SELINUX 设置为启用。这个 SELINUX 是 linux 提供的额外的安全层。在这种情况下,我们将无法创建私钥和公钥。我们已向用户提供许可。但不是在应用程序级别。

      为此,请转到 /etc/selinux/config 并设置 SELINUX=disable

      【讨论】:

        猜你喜欢
        • 2021-01-21
        • 2011-02-11
        • 1970-01-01
        • 2015-06-18
        • 2021-07-11
        • 1970-01-01
        • 2022-01-19
        • 1970-01-01
        • 2022-06-24
        相关资源
        最近更新 更多