Ssh login OK, but scp failed

I can log in to ssh because I still asked for my publickey password and successfully logged in

.

but not when scp transfers files

commands executed by the local root
scp-r-p $SERVERPORT $ROOTDIR $SERVERUSERNAM@$SERVERIPV4:/home/$SERVERUSERNAME/Documents/scripts

display
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).

ordinary user executes the command
su-$CURRENTUSER-c "scp-r-p $SERVERPORT $ROOTDIR $SERVERUSERNAM@$SERVERIPV4:/home/$SERVERUSERNAME/Documents/scripts"

Show
transfer file
Host key verification failed.
lost connection

root is disabled on the server, and
has been modified

.

PermitRootLogin no
DenyUsers root
PermitEmptyPasswords no
IgnoreRhosts yes
HostbasedAuthentication no

ask for your help, thank you.

Jul.09,2021

Use uppercase P

when

scp specifies the port.

 scp -P 2200 yourname@yourserver.com:/home/aaa/a.txt ./
  • How shell ssh executes multiple local scripts to download in a bash environment

    We know: ssh root@host -C " bin bash" < 1.sh you can execute local scripts. but now there are two scripts, 1.sh and 2.sh, where 1.sh is the configuration file and 2.sh needs to use the configuration file variables. excuse me, how do ss...

    Mar.24,2021
  • Ssh remote login for advice

    1 this is how I logged in ssh $SERVERUSERNAME@$SERVERIPV4-p $SERVERPORT < < serveraction ~ Code ~ serveraction the result window always prompts Pseudo-terminal will not be allocated because stdin is not a terminal. what does this mean? do I ...

    Jul.11,2021
Menu