-2
[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

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

4

2 回答 2

1

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

于 2012-12-31T18:08:27.983 回答
0

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

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

于 2015-05-29T20:20:41.343 回答