If you are getting this error then you probably reset the permissions on your hidden .ssh directory in your user folder, and your keys aren’t going to work anymore. It’s very important that these files not be writable by just anybody with a login to the box, so openssh will give you an error if you try to use them.

The full error message:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0744 for '/home/geek/.ssh/id_rsa' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /home/geek/.ssh/id_rsa

To fix this, you’ll need to reset the permissions back to default:

sudo chmod 600 ~/.ssh/id_rsa
sudo chmod 600 ~/.ssh/id_rsa.pub

If you are getting another error:

Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/home/geek/.ssh/known_hosts).

This means that the permissions on that file are also set incorrectly, and can be adjusted with this:

sudo chmod 644 ~/.ssh/known_hosts

Finally, you may need to adjust the directory permissions as well:

sudo chmod 755 ~/.ssh

Fixing “WARNING: UNPROTECTED PRIVATE KEY FILE!” on Linux的更多相关文章

  1. ssh使用秘钥文件连接提示WARNING: UNPROTECTED PRIVATE KEY FILE!(转载)

    转自:http://www.01happy.com/ssh-unprotected-private-key-file/ 在centos 6.4下使用ssh连接远程主机时,用的是另外一个密钥,需要用-i ...

  2. docker postgresql FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied

    在docker中启动postgresql时出现错误 FATAL:  could not access private key file "/etc/ssl/private/ssl-cert- ...

  3. Python paramiko 报错 paramiko.ssh_exception.SSHException: not a valid RSA private key file

    报错的原因是选择的文件不是一个有效的 RSA 密钥文件 现在通过 ssh-keygen 默认生成的密钥文件是新的格式,并非 RSA 格式.打开文件可以看到是以 -----BEGIN OPENSSH P ...

  4. windows,linux,mac生成ssh public key 和 private key

    https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair Creating the key How you create your SSH ...

  5. 密钥public/private key登陆linux

    Public Key认证是什么这是一种认证方法,类似于常见的用户名密码认证方法.不同的是需要在客户端机器上保留一个很长很长的加密key,而在服务器端需要做出相应的配置.当客户端想要访问服务器时,服务器 ...

  6. Xshell配置密钥公钥(Public key)与私钥(Private Key)登录

    ssh登录提供两种认证方式:口令(密码)认证方式和密钥认证方式.其中口令(密码)认证方式是我们最常用的一种,这里介绍密钥认证方式登录到linux/unix的方法. 使用密钥登录分为3步:1.生成密钥( ...

  7. Xshell配置ssh免密码登录-密钥公钥(Public key)与私钥(Private Key)登录【已成功实例】

    本文转自https://blog.csdn.net/qjc_501165091/article/details/51278696 ssh登录提供两种认证方式:口令(密码)认证方式和密钥认证方式.其中口 ...

  8. MyISAM引擎表出现“Error 'Incorrect key file for table”

    mysql主从复制中的从库突然出现了警报,sql_thread停止了,show slave status\G;查看 mysql> show slave status\G ; . row **** ...

  9. Fix the “No Private Key” Error Message

    This article will show you how to correct the “No Private Key” error message in Windows Internet Inf ...

随机推荐

  1. iOS学习05C语言函数

    本次主要是学习和理解函数,函数树状图如下: 1.函数的声明和定义 函数定义的四要素分别为: 返回值类型 :函数的结果值类型,函数不能返回数组. 指定返回类型是void类型说明函数没有返回值. 函数名 ...

  2. BZOJ3659 : Which Dreamed It

    首先判断一下是否无解,并剔除孤立点. 根据best theorem,有向图中以$i$为起点的欧拉回路个数为: 以$i$为根的树形图个数$\times\prod_{i=1}^n (deg(i)-1)!$ ...

  3. 关于Div的宽度与高度的100%设定

    http://www.cnblogs.com/clare-zhang/archive/2011/08/26/2154220.html 正像你所知道的那样,设置DIV大小的有两个属性width和heig ...

  4. cdoj 树上战争(Battle on the tree) Label:并查集?

    给一棵树,如果树上的某个节点被某个人占据,则它的所有儿子都被占据,lxh和pfz初始时分别站在两个节点上,谁当前所在的点被另一个人占据,他就输了比赛,问谁能获胜. Input 输入包含多组数据 每组第 ...

  5. 【BZOJ】2938: [Poi2000]病毒

    题意 \(n\)个01病毒串,总长不超过\(30000\).问是否存在无限长的不包含病毒串的01串. 分析 考虑ac自动机,如果不包含病毒串而且无限长也就是说存在一个环(转移和fail树),使得环上不 ...

  6. NOI模拟赛 Day1

    [考完试不想说话系列] 他们都会做呢QAQ 我毛线也不会呢QAQ 悲伤ING 考试问题: 1.感觉不是很清醒,有点困╯﹏╰ 2.为啥总不按照计划来!!! 3.脑洞在哪里 4.把模拟赛当作真正的比赛,紧 ...

  7. Using Maven to generate a Java Project or Web project

    I often to generate a Java project or Web project with Eclipse tool. Well, I have no idea when I wan ...

  8. Max Sum Plus Plus——A

    A. Max Sum Plus Plus Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To ...

  9. Trie字典树 静态内存

    静态字典树 看了好久的字典树,挺简单的一个结构,愣是看了这么久才写出来... 专心一点就不会这样了.... 接下来就去刷刷字典树的题吧....... 下面是字典树.... 定义节点 typedef s ...

  10. inline,block,inline-block的区别

    display:block block元素会独占一行,多个block元素会各自新起一行.默认情况下,block元素宽度自动填满其父元素宽度. block元素可以设置width,height属性.块级元 ...