【转】腾讯云-解决Winscp permission denied的问题

刚刚注册完腾讯云,因为要用来跑作业代码,所以操作系统选择的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
來源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。
原文地址:https://www.cnblogs.com/xuxml/p/10402621.html