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. iOS--子视图如何穿透上层视图响应事件

    一.使用方法:- (nullable UIView *)hitTest:(CGPoint)point withEvent:(nullable UIEvent *)event; 二.背景知识iOS系统检 ...

  2. POJ2546 Circular Area(计算几何)

                                                                                Circular Area            ...

  3. Longest Valid Parentheses - LeetCode

    Given a string containing just the characters '(' and ')', find the length of the longest valid (wel ...

  4. SecureCRT分屏显示

    [Tab右键]或者[Session Manager右键]->[Send to New Tab Group]

  5. ylb: 数据库备份(Backup)和还原(Restore)

    ylbtech-SQL Server:SQL Server- 数据库备份(Backup)和还原(Restore) -- ======================================== ...

  6. ElasticSearch和Hive做整合

    1.上传elasticsearh-hadoop的jar包到server1-hadoop-namenode-01上 在server1-hadoop-namenode-01上执行: cp  /home/d ...

  7. 2016.11.14 MIT challenge之课程总览

    Degree Chartshttp://catalog.mit.edu/degree-charts/computer-science-engineering-course-6-3/ MIT Chall ...

  8. centos 安装 htop

    centos-install-htop http://elearning.wsldp.com/pcmagazine/centos-install-htop/

  9. 雕刻效果的实现【OpenCV+QT】

    雕刻能够区分为凸雕和凹雕. 凸雕基右下角的点减去左上角的点. 凹雕是左上角的点减去右下角的点. [效果图] 由于进行了缩放.效果看起来差一些.

  10. 调用聚合数据新闻头条API

    基于聚合数据新闻头条接口 支持阅读新闻类型包括: 各类社会.国内.国际.体育.娱乐.科技等资讯,更新周期5-30分钟. 新闻内容类型的多选,支持皮肤功能. 使用前需要有聚合数据账号,并实名制后通过 新 ...