解决往服务器传文件时权限不够问题
1.问题描述
- 在使用远程拷贝时出现了权限问题,我想把一个文件传到230服务器上报了以下错误:
- 检查了下需要上传的文件夹权限,改为0666也无法解决
- 使用XFTP传也遇到一样的问题
root@ubuntu14:/home/kingram/sourceCode/parkgateway# scp -r webset/ mv@192.168.200.230:/home/mv/gateway
mv@192.168.200.230's password:
scp: /home/mv/gateway/webset/main.go: Permission denied
scp: /home/mv/gateway/webset/models: Permission denied
scp: /home/mv/gateway/webset/utils: Permission denied
scp: /home/mv/gateway/webset/service: Permission denied
scp: /home/mv/gateway/webset/templates/login.html: Permission denied
scp: /home/mv/gateway/webset/templates/gatewayStatus.html: Permission denied
scp: /home/mv/gateway/webset/templates/guidePage1.html: Permission denied
scp: /home/mv/gateway/webset/templates/indexHeader.html: Permission denied
scp: /home/mv/gateway/webset/templates/paramsConfig.html: Permission denied
scp: /home/mv/gateway/webset/templates/laneStatus.html: Permission denied
scp: /home/mv/gateway/webset/templates/static/img/laneBgUn.png: Permission denied
scp: /home/mv/gateway/webset/templates/static/img/background.png: Permission denied
scp: /home/mv/gateway/webset/templates/static/img/guide1.png: Permission denied
scp: /home/mv/gateway/webset/templates/static/img/bg.png: Permission denied
scp: /home/mv/gateway/webset/templates/static/img/guide2.png: Permission denied
scp: /home/mv/gateway/webset/templates/static/img/iconPs.png: Permission denied
scp: /home/mv/gateway/webset/templates/static/img/sence.png: Permission denied
scp: /home/mv/gateway/webset/templates/static/img/iconUn.png: Permission denied
scp: /home/mv/gateway/webset/templates/static/img/laneBg.png: Permission denied
scp: /home/mv/gateway/webset/templates/static/img/guide3.png: Permission denied
scp: /home/mv/gateway/webset/templates/static/img/loginBg.png: Permission denied
scp: /home/mv/gateway/webset/templates/static/img/iconNor.png: Permission denied
scp: /home/mv/gateway/webset/templates/static/img/loading.png: Permission denied
scp: /home/mv/gateway/webset/templates/static/img/logo.png: Permission denied
scp: /home/mv/gateway/webset/templates/static/img/iconAcc.png: Permission denied
scp: /home/mv/gateway/webset/templates/static/js/networkConfig.js: Permission denied
scp: /home/mv/gateway/webset/templates/static/js/gatewayStatus.js: Permission denied
scp: /home/mv/gateway/webset/templates/static/js/aside.js: Permission denied
scp: /home/mv/gateway/webset/templates/static/js/echarts.min.js: Permission denied
scp: /home/mv/gateway/webset/templates/static/js/indexHeader.js: Permission denied
scp: /home/mv/gateway/webset/templates/static/js/guidePage2.js: Permission denied
scp: /home/mv/gateway/webset/templates/static/js/jquery.min.js: Permission denied
scp: /home/mv/gateway/webset/templates/static/js/login.js: Permission denied
scp: /home/mv/gateway/webset/templates/static/js/laneStatus.js: Permission denied
scp: /home/mv/gateway/webset/templates/static/js/guidePage3.js: Permission denied
scp: /home/mv/gateway/webset/templates/static/js/paramsConfig.js: Permission denied
scp: /home/mv/gateway/webset/templates/static/js/guidePage1.js: Permission denied
scp: /home/mv/gateway/webset/templates/static/css/login.css: Permission denied
scp: /home/mv/gateway/webset/templates/static/css/laneStatus.css: Permission denied
scp: /home/mv/gateway/webset/templates/static/css/paramsConfig.css: Permission denied
scp: /home/mv/gateway/webset/templates/static/css/guidePage2.css: Permission denied
scp: /home/mv/gateway/webset/templates/static/css/gatewayStatus.css: Permission denied
scp: /home/mv/gateway/webset/templates/static/css/guidePage1.css: Permission denied
scp: /home/mv/gateway/webset/templates/static/css/networkConfig.css: Permission denied
scp: /home/mv/gateway/webset/templates/static/css/indexHeader.css: Permission denied
scp: /home/mv/gateway/webset/templates/static/css/guidePage3.css: Permission denied
scp: /home/mv/gateway/webset/templates/static/css/aside.css: Permission denied
scp: /home/mv/gateway/webset/templates/aside.html: Permission denied
scp: /home/mv/gateway/webset/templates/guidePage3.html: Permission denied
scp: /home/mv/gateway/webset/templates/guidePage2.html: Permission denied
scp: /home/mv/gateway/webset/templates/networkConfig.html: Permission denied
2.解决方法
root@ubuntu14:/home/kingram/sourceCode/parkgateway# python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 ...
192.168.200.230 - - [27/Jul/2020 14:53:19] "GET /parkgateway HTTP/1.1" 200 -
root@mv-Super-Server:/home/mv/gateway# wget http://192.168.200.215:8000/parkgateway
--2020-07-27 15:24:33-- http://192.168.200.215:8000/parkgateway
正在连接 192.168.200.215:8000... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度: 36047259 (34M) [application/octet-stream]
正在保存至: “parkgateway”
parkgateway 100%[==============================================>] 34.38M 11.2MB/s in 3.1s
2020-07-27 15:24:37 (11.2 MB/s) - 已保存 “parkgateway” [36047259/36047259])