sftp -b batchfile username@remote_host

报错:Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)

因为SSH不能访问你的authorized_keys,所以必需先认证然后才能访问

remote_host,root登陆

# mkdir /etc/ssh/<username>

# cp /home/<username>/.ssh/authorized_keys /etc/ssh/<username>/

# chmod 755 /etc/ssh/<username>

# chmod 600 /etc/ssh/<username>/authorized_keys

# chown -R username:username /etc/ssh/<username>

3. 编辑配置文件/etc/ssh/sshd_config并添加下列内容

# vi /etc/ssh/sshd_config

AuthorizedKeysFile    /etc/ssh/%u/authorized_keys

4. 重启SSH

# /etc/init.d/sshd restart

Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)的更多相关文章

  1. github提交代码时,报permission denied publickey

    在像github提交代码时,报permission denied publickey. 查找了一下,可能是因为github的key失效了. 按照以下步骤,重新生成key. ssh-keygen 一路默 ...

  2. SSH Key连接github提示Permission denied (publickey).错误

    root@debian64:/home/xiaoliuzi/.ssh/key_backup# ssh -T git@github.com The authenticity of host 'githu ...

  3. ssh 协议执行repo sync 报错:Permission denied (publickey)

    1.ssh key 已经添加ssh key到gerrit服务器,并且执行ssh协议的git clone可以正常克隆代码到本地,可见不是ssh key的问题. 2.manifest清单文件配置 最初在m ...

  4. ssh localhost “Permission denied (publickey)

    再次遇到 SSH Server And "Permission denied (publickey) 用这个关键词搜索才找到howtogeek上答案: sshd : Authenticati ...

  5. 由于SSH配置文件的不匹配,导致的Permission denied (publickey)及其解决方法。

    读者如要转载,请标明出处和作者名,谢谢.地址01:http://space.itpub.net/25851087地址02:http://www.cnblogs.com/zjrodger/作者名:zjr ...

  6. ubuntu下git clone 出现Permission denied (publickey).

    今天在ubuntu上使用git 克隆 github上面的库,一直权限拒绝Permission denied (publickey). 公钥绑了好几次,都不行: 最后怀疑是git配置公钥地址有问题:打开 ...

  7. Permission denied (publickey).

    问题: ssh-keygen -t rsa -C "youremail@example.com" 若是接连按三次回车,会在-/.ssh下生成 id_rsa, id_rsa.pub ...

  8. SSH方式登录github出现Permission denied (publickey)

    今天在公司上传了代码,回到家pull,结果竟然出现了“Permission denied (publickey)“这种东西.第一反应是key不对,可是上次明明用key登录过,不可能不对啊,难道是文件被 ...

  9. github Permission denied (publickey)解决办法

    想要玩玩git,参考了网友懒惰之计的一篇Blog<github:如何获取项目源代码 >,按部就班完成了所有的步骤的, 可在测试的时候,遇到了问题,总是报错”github Permissio ...

  10. [置顶] github 出现 Permission denied (publickey)的解决

    今天写了一篇博客,想push到github上的时候出现了以下错误 Permission denied (publickey). fatal: The remote end hung up unexpe ...

随机推荐

  1. Android Studio插件Gsonformat的安装和使用

    在开发中,我们获得服务端的json数据后要建立自己的bean,但是一条一条写相当麻烦,使用了GsonFormat插件,用起来非常方便. 安装 方法1: 1.Android studio File-&g ...

  2. Find Median from Data Stream - LeetCode

    Median is the middle value in an ordered integer list. If the size of the list is even, there is no ...

  3. 转:ospf学习-----SPF最短路径算法

    ospf学习-----SPF最短路径算法 常见的路由协议比如RIP.IGRP.BGP是距离矢量协议,OSPF和ISIS是数据链路状态协议.矢量协议路由器只知道本身和与自身相连的接口路由信息,矢量图只是 ...

  4. php类中静态变量与常亮的区别

    在效率上:常量编译过程比静态变量快的多. 代码: <?php error_reporting(E_ALL); class A { const c = 9; public static $b = ...

  5. Android中的多线程断点续传

    Android多线程断点下载的代码流程解析: 运行效果图: 实现流程全解析: Step 1:创建一个用来记录线程下载信息的表 创建数据库表,于是乎我们创建一个数据库的管理器类,继承SQLiteOpen ...

  6. andriod GridLayout

    来自:http://blog.csdn.net/jianghuiquan/article/details/8299973 GridLayout网格布局 android4.0以上版本出现的GridLay ...

  7. 11.【nuxt起步】-登录验证

    1.新建/pages/login.vue 2.安装cookie Cnpm install js-cookie --s 3.Login.vue增加 import Cookie from 'js-cook ...

  8. 【转载】C++11的简单学习

    首先在我们的开发机以及线上机器一般都安装了C++11,目录在: /opt/compiler/gcc-4.8.2/ 看了下面这篇文章<[C++11]30分钟了解C++11新特性> http: ...

  9. 正确理解hadoop 2.x 的环形缓冲区: (一) MR环形缓冲区的结构

    转载:http://blog.csdn.net/HADOOP_83425744/article/details/49560583 http://bigdatadecode.club/MapReduce ...

  10. 2017.2.12 开涛shiro教程-第七章-与Web集成

    2017.2.9 开涛shiro教程-第七章-与Web集成(一) 原博客地址:http://jinnianshilongnian.iteye.com/blog/2018398 根据下载的pdf学习. ...