我可以ssh登陆,因为当时还要求我publickey的密码并且成功登陆了
但是scp传输文件的时候就是不行
本地root执行的命令
scp -r -p $SERVERPORT $ROOTDIR $SERVERUSERNAM@$SERVERIPV4:/home/$SERVERUSERNAME/Documents/scripts
显示
transfer file
root@192.168.27.150's password:
Permission denied, please try again.
root@192.168.27.150's password:
Permission denied, please try again.
root@192.168.27.150's password:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
普通用户执行命令
su - $CURRENTUSER -c "scp -r -p $SERVERPORT $ROOTDIR $SERVERUSERNAM@$SERVERIPV4:/home/$SERVERUSERNAME/Documents/scripts"
显示
transfer file
Host key verification failed.
lost connection
服务器禁用root了,
修改的地方有
PermitRootLogin no
DenyUsers root
PermitEmptyPasswords no
IgnoreRhosts yes
HostbasedAuthentication no
请求大家的帮助,谢谢。
相关分类