当前位置: 动力学知识库 > 问答 > 编程问答 >

getting permission denied while creating SSH

问题描述:

[[email protected] ~]$ ssh-keygen -t rsa -C "[email protected]"

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 [email protected]

The key's randomart image is:

+--[ RSA 2048]----+

| . . |

| . o + |

| . . o . |

|o o = |

|+ = S |

|+. + . |

|*+ . |

|Bo . . |

| E. . |

+-----------------+

[[email protected] ~]$ /home/sneha/.ssh/id_rsa.pub

bash: /home/sneha/.ssh/id_rsa.pub: Permission denied

can anyone help? i'm pretty sure i am doing everything required

网友答案:

id_rsa.pub is not an executable file, it's a public key. Trying to run a regular file will give you a permission denied error. What are you trying to do? Normally you would append that file to ~/.ssh/authorized_keys on the server you are connecting to.

网友答案:

The reason can be the SELINUX is set to enabled. This SELINUX is an extra layer of security provided by linux. In such a case we won’t be able to create the private and public key. We have permission provided to users. But not at Applications level.

To do this go to /etc/selinux/config and set SELINUX=disable

分享给朋友:
您可能感兴趣的文章:
随机阅读: