【轉】騰訊雲-解決Winscp permission denied的問題

剛剛註冊完騰訊雲,由於要用來跑做業代碼,因此操做系統選擇的Ubuntu 16.04 32位服務器

用Winscp登錄以後出現了錯誤代碼爲3的permission denied的錯誤,不能建立路徑,也不能上傳文件ssh

後來發現是缺少超級權限致使的,在網上找到了解決方法:spa

http://msiyuetian.blog.51cto.com/8637744/1770016操作系統

如下是原文:

系統環境:Ubuntu 14.04rest

問題:普通用戶使用 winscp 本地上傳文件到系統裏面去會報以下錯誤:blog

無權訪問。it

錯誤碼:3io

服務器返回的錯誤消息:Permission deniedclass

 

 
 

這是由於要管理員權限的,而又不想給普通用戶賦予管理員權限。因此這裏開啓root帳號只用於上傳文件。Ubuntu 默認是沒有開啓 root 帳號的,而且咱們提倡最好不要用 root 帳號直接操做系統,開啓 root 帳號步驟以下:date

一、首先設置 root 密碼

luban@PDS-WEB:~$ sudo passwd root

[sudo] password for luban:                                    //輸入當前普通用戶的密碼

Enter new UNIX password:                                    //給root設置密碼

Retype new UNIX password:                                 //確認輸入密碼

passwd: password updated successfully

二、修改 /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」

三、重啓 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 來源:簡書 簡書著做權歸做者全部,任何形式的轉載都請聯繫做者得到受權並註明出處。
相關文章
相關標籤/搜索