剛剛注冊完騰訊雲,因為要用來跑作業代碼,所以操作系統選擇的Ubuntu 16.04 32位
用Winscp登陸之后出現了錯誤代碼為3的permission denied的錯誤,不能創建路徑,也不能上傳文件
后來發現是缺乏超級權限導致的,在網上找到了解決方法:
http://msiyuetian.blog.51cto.com/8637744/1770016
以下是原文:
系統環境:Ubuntu 14.04
問題:普通用戶使用 winscp 本地上傳文件到系統里面去會報如下錯誤:
無權訪問。
錯誤碼:3
服務器返回的錯誤消息:Permission denied

這是因為要管理員權限的,而又不想給普通用戶賦予管理員權限。所以這里開啟root賬號只用於上傳文件。Ubuntu 默認是沒有開啟 root 賬號的,並且我們提倡最好不要用 root 賬號直接操作系統,開啟 root 賬號步驟如下:
1、首先設置 root 密碼
luban@PDS-WEB:~$ sudo passwd root
[sudo] password for luban: //輸入當前普通用戶的密碼
Enter new UNIX password: //給root設置密碼
Retype new UNIX password: //確認輸入密碼
passwd: password updated successfully
2、修改 /etc/ssh/sshd_config 文件
luban@PDS-WEB:~$ su - root
Password:
root@PDS-WEB:~# vi /etc/ssh/sshd_config
# Authentication:
LoginGraceTime 120
#PermitRootLogin without-password
PermitRootLogin yes
StrictModes yes
說明:注釋掉 “PermitRootLogin without-password”,添加“PermitRootLogin yes”
3、重啟 ssh 服務
root@PDS-WEB:~# service ssh restart
ssh stop/waiting
ssh start/running, process 1335
root@PDS-WEB:~#
操作完成后就可以通過 root 賬號登入 winscp 了。
作者:DonnieZero
鏈接:https://www.jianshu.com/p/0cd6ecc33a5c
來源:簡書
簡書著作權歸作者所有,任何形式的轉載都請聯系作者獲得授權並注明出處。