Ubuntu: Use of scp command and solution to Permission denied error

scp command introduction

The scp command is used to copy files and directories between Linux. scp is the abbreviation of secure copy. scp is a secure remote file copy command based on ssh login under the Ubuntu system .

scp local_file remote_username@remote_ip:remote_folder 

scp /Users/X.pem [email protected]:/usr/local/ssl

Permission denied error

This is because the target folder does not have write permissions, so you need to modify the write permissions of the target folder.

Take the Ubuntu server-side folder /usr/local/ssl as an example:

chmod 777 /usr/local/ssl/

Operation not permitted error

This is because the computer client needs to operate under sudo authority. Please execute it first, enter su, and then enter the password (the password will not echo the characters, just enter the correct password and press Enter). If the password is successfully entered, the command line waiting screen will appear. Operation successful.

Command input:

su

display effect:

After resolving the folder permissions, upload again, and finally the upload is successful.

Guess you like

Origin blog.csdn.net/qq_29855509/article/details/126803249