scp 报错: Permission denied, please try again(publickey,password)

2023-05-16

修改密码后导致报错  :Permission denied, please try again(publickey,password)

 

修改 /etc/ssh/sshd_config  中:

PermitRootLogin yes     #修改为yes

重启服务:

systemctl restart ssh.service

或者

sudo service ssh restart   

 

/etc/ssh/sshd_config :

#	$OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin prohibit-password
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#PubkeyAuthentication yes

# Expect .ssh/authorized_keys2 to be disregarded by default in future.
#AuthorizedKeysFile	.ssh/authorized_keys .ssh/authorized_keys2

#AuthorizedPrincipalsFile none

#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
PrintMotd no
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none

# no default banner path
#Banner none

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

# override default of no subsystems
Subsystem	sftp	/usr/lib/openssh/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
#	X11Forwarding no
#	AllowTcpForwarding no
#	PermitTTY no
#	ForceCommand cvs server

 

 

参考资料: 

https://www.codeleading.com/article/47942468650/

https://www.pianshen.com/article/7307868681/

https://blog.csdn.net/situliang/article/details/72904449

 

 

 

 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

scp 报错: Permission denied, please try again(publickey,password) 的相关文章

随机推荐

  • Java多线程编程技术总结

    目录 1 退出线程的3种方式 xff1a 1 1 判断线程是否中断 xff1f 1 2 interrupt 1 3 stop 1 4 StackTraceElement getStackTrace 方法 2 suspend 和resume
  • 【Mysql】视图

    Mysql 视图 1 什么是视图 xff08 MySQL 5以及以上版本 xff09 2 视图的优点3 视图的规则与限制4 使用视图附录 1 什么是视图 xff08 MySQL 5以及以上版本 xff09 视图是虚拟的表 与包含数据的表不一
  • AIDL的原理实现

    前言 Binder 驱动是基于 CS 模型设计的跨进程通信驱动 想要使用 Binder 驱动进行通信 需要三个步骤 定义交互规范服务端实现客户端实现 一 定义交互规范 span class token keyword public span
  • 微信小程序9---Button按钮和icon图标

    Button 按钮 首先提醒一下大家 xff0c 如果你现在button标签不能用 xff0c 不用担心 xff0c 那是因为微信小程序存在一个bug xff0c 你仔细看一下你的button标签的代码是不是这样的 span class h
  • 微信小程序10---条件语句if和循环语句for(三目运算+hidden)

    在微信小程序的官方文档中 xff0c 将这两个语句归化在框架的视图层 xff0c 分表叫条件渲染和类表渲染 xff0c 其实他就是封装了这两条语句而已 上图 xff08 循环语句if xff09 1 它是通过在index js中设置数据 x
  • 微信小程序13--通过api接口将json数据展现到小程序上

    实现知乎客户端的一个重要知识前提就是 xff0c 要知道怎么通过知乎新闻的接口 xff0c 来把数据展示到微信小程序端上 那么我们这一就先学习一下 xff0c 如何将接口获取到的数据展示到微信小程序上 1 用到的知识点 lt 1 gt wx
  • 微信小程序15---将组件设置为圆形

    1 上图 2 index wxss 宽高和弧度的设置 span class hljs class circle span span class hljs rules span class hljs rule span class hljs
  • Android---给Linearlayout设置边框+弧度角

    1 第一步需要在drawable下创建一个xml文件 xff0c 代码如下 span class hljs pi lt xml version 61 34 1 0 34 encoding 61 34 utf 8 34 gt span spa
  • HttpServletRequest获取body && 使用 @RequestBody 获取body

    直接从HttpServletRequest的Reader流中获取请求body参数 span class token annotation punctuation 64 RequestMapping span span class token
  • P1002 [NOIP2002 普及组] 过河卒

    题目描述 棋盘上 A 点有一个过河卒 xff0c 需要走到目标 B 点 卒行走的规则 xff1a 可以向下 或者向右 同时在棋盘上 C 点有一个对方的马 xff0c 该马所在的点和所有跳跃一步可达的点称为对方马的控制点 因此称之为 马拦过河
  • 3D Slicer源代码编译与调试

    2019 11 12 参考以下链接 xff1a https www slicer org wiki Documentation Nightly Developers Build Instructions Windows 需要注意的有 xff
  • DSP Group, Inc. <DSPG>

    公司官网 xff1a DSP Group Leading global provider of wireless chipset solutions About DSP Group DSP Group Inc NASDAQ DSPG is
  • 数组或对象指定下标赋值及下拉数据转化

    一 数组指定下标赋值 span class token variable let span span class token variable myarr span span class token punctuation 61 span
  • XMOS 开发探索3-麦克风拾音

    date 2021 03 29 XMOS 评估板型号 xff1a XUF216 512 TQ128 C20 实现麦克风拾音 xff0c 并从耳机输出声音 xff0c 官方网站上的一个demo xff1a Application Notes
  • 安装ubuntu系统中磁盘分区

    硬件 xff1a vostro 1450 xff0c 本身有一块机械硬盘HDD xff08 500G xff09 加了一块固态硬盘SSD xff08 120G xff09 xff0c 组成HDD 43 SSD双硬盘 目的 xff1a SDD
  • win7+ubuntu双系统 -- ubuntu无法启动

    硬件 xff1a vostro 1450 xff0c 本身有一块机械硬盘HDD xff08 500G xff09 加了一块固态硬盘SSD xff08 120G xff09 xff0c 组成HDD 43 SSD双硬盘 目的 xff1a SDD
  • Xshell 和 Xftp 学校免费版

    Xshell 和 Xftp 家庭 学校免费版下载地址 xff1a 家庭 学校免费 NetSarang Website 填写姓名和邮箱 xff0c 下载免费版 xff0c 会发送邮件到邮箱 45M 安装完成并打开 xff1a 39M 用来传输
  • putty pscp psftp 三件套

    官网地址 xff1a https www chiark greenend org uk sgtatham putty https www chiark greenend org uk sgtatham putty latest html p
  • win10远程连接win7电脑 -- 局域网实现

    本次 xff1a 使用 windows自带 的 远程桌面连接 xff08 ok xff09 另外 xff1a 向日葵 远程软件更方便 xff0c 可以直接在公网使用 xff08 get xff09 TeamViewer 远程软件越来越不好用
  • scp 报错: Permission denied, please try again(publickey,password)

    修改密码后导致报错 Permission denied please try again publickey password 修改 etc ssh sshd config 中 PermitRootLogin yes 修改为yes 重启服务