Mac 从本地copy项目到服务器

复制一个文件到服务器

scp -p 22 /Applications/MAMP/htdocs/h.php  root@47.101.131.113://var/www/html

上面往往是端口,root开始是服务器的帐号和根目录,我的是apache所以根目录在/var/www/html目录下面,h.php那一串是我的文件根目录和文件名。

复制一个文件夹(目录)到服务器

scp -r -P 22 /Applications/MAMP/htdocs/api root@47.101.130.113://var/www/html/

以上是复制api这个目录到服务器的根目录。

命令:

scp -r -P 22 /Users/liutao/Desktop/vagrant/newproject/pdfbox 2.zip  root@52.38.3://home/wwwroot/

报错:

The authenticity of host '52.7.43 (52.07.43)' can't be established.

ECDSA key fingerprint is SHA256:NJPQbBzxeHzBzVYzbEjzMDoXsNaw7+d938cVtIc9Rw8.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '52.38.207.43' (ECDSA) to the list of known hosts.

root@52.387.43: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

lost connection

 

带上密钥:

scp -i ./ioshelpertests.pem /Users/mlh/python/space/Real-Time-Voice-Cloning.zip centos@35..65:/home/centos/

 

成功上传:

sudo scp -i /Users/liutao/Desktop/wangbogamenew.pem  /Users/liutao/Desktop/vagrant/newproject/pdfbox2.zip  centos@527.43:/tmp/
pdfbox2.zip                           

 

posted @ 2019-11-16 18:17  码农编程进阶笔记  阅读(41)  评论(0编辑  收藏  举报
返回顶部 有事您Q我