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


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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM