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. codevs——1169 传纸条(棋盘DP)

    2008年NOIP全国联赛提高组  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 钻石 Diamond 题解  查看运行结果     题目描述 Description 小渊和小 ...

  2. luogu P1616 疯狂的采药

    题目背景 此题为NOIP2005普及组第三题的疯狂版. 此题为纪念LiYuxiang而生. 题目描述 LiYuxiang是个天资聪颖的孩子,他的梦想是成为世界上最伟大的医师.为此,他想拜附近最有威望的 ...

  3. Dcokerfile 参考

    Dcokerfile 包含了所有用来组装image的命令.通过docker build来自动创建image.   用法 需要指定本地路径作为上下文目录,路径是本地系统的目录.而docker build ...

  4. flannel无法跨主机ping通容器的解决方式

    前几天,出现了无法跨主机ping通容器的情况,导致一个node机网络中断,无法访问,排查过程如下. 首先确认,宿主机node2是可以ping通容器 [root@node2 ~]# ping 10.1. ...

  5. xamarin.ios 本地通知推送

    由于ios10版本以后UILocalNotification被标为弃用了,所以要添加新的本地通知推送功能,下面提供一些代码参考. 一.先在AppDelegate.cs上注册本地通知推送功能. publ ...

  6. dedecms让channelartlist标签支持currentstyle属性方

    把dedecms中用channelartlist当导航的站很普遍,但是有的站需要用到当前页中导航样,就是随着不同的页面,导航样式也随着变化. 首先打开include\taglib\channelart ...

  7. linux df -h卡成狗

    linux执行df -h命令,直接卡在,很久没有任何动静 strace df -h跟踪命令执行,查看卡在那里 还有可能就是重做系统吧,检测下内存条是不是坏了等 http://blog.51cto.co ...

  8. newlisp HTTP Basic Authentication

    HTTP Basic Authentication原来很easy,參考文档:http://zh.wikipedia.org/wiki/HTTP%E5%9F%BA%E6%9C%AC%E8%AE%A4%E ...

  9. mysql下监测数据库语句creating sort index时间过长的问题

    在一张单表5000W数据上进行数据查询时传入两个单列索引条件,进行组合索引查询时,如果最后有order by id排序,与去除该排序,性能差距接近两个数量级 结论:在使用列的默认排序时,不应该再ord ...

  10. POJ 开关问题 1830【高斯消元求矩阵的秩】

    Language: Default 开关问题 Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 6656   Accepted: ...