当前位置:网站首页 / Linux / 正文

Ubuntu16.04设置sudo权限并安装ftp服务器

时间:2018年05月06日 | 作者 : liuhui | 分类 : Linux | 浏览: 7286次 | 评论 0

阿里云限量代金券 | 此广告位出租25元/月

创建用户

sudo adduser username

为普通用户添加sudo权限

sudo功能的配置文件一般在这里:/etc/sudoers,可以使用gedit 编辑。然而/etc/sudoers的配置文件的注释里说明了,不建议直接修改/etc/sudoers,而是通过在/etc /sudoers.d/文件夹中新增文件来完成配置。

 Please consider adding local content in /etc/sudoers.d/ instead of directly modifying this file.

新增的文件就用gedit编辑就可以了,比如说要为xxxx增加sudo权限,就增加一个文件,文件名无所谓,内容是:
xxxx_1 ALL=(ALL) ALL
保存,退出。
然后需要把这个文件权限设置为400: chmod 400 xxxxx 
再用xxxxx用户登录后就可以使用sudo权限了。

Ubuntu16.04安装ftp服务器

sudo apt-get updatesudo apt-get install vsftpd

修改ftp的配置文件 /etc/vsftpd.conf

(a)向文件中添加如下内容:
userlist_deny=NO 
userlist_enable=YES 
#允许登录的用户 userlist_file=/etc/allowed_users 
seccomp_sandbox=NO 
local_enable=YES 
#设置文件上传 write_enable=YES 
#使用utf8utf8_filesystem=YES

1.png

使文件中的"local_enable=YES"保存。

(b)新建/etc/allowed_users文件
sudo gedit /etc/allowed_users
假设我只想让xuanxufeng和root访问ftp服务器,那么输入xuanxufeng,root-->保存OK!以后还有其它用户使用ftp时直接添加用户名就可以了!(c)使用gedit查看/etc/ftpusers文件中的内容
sudo gedit /etc/ftpusers
打开这个文件后,看一看有没有uftp这个用户名,如果没有,就直接退出。如果有就删除uftp,因为这个文件中记录的是不能访问FTP服务器的用户清单。
重启vsftp服务器。
2. 启动停止重启服务
sudo /etc/init.d/vsftpd startsudo /etc/init.d/vsftpd stopsudo /etc/init.d/vsftpd restart3. 访问ftp服务器
sudo ftp 127.0.0.1浏览器访问 
ftp://127.0.0.1 或者 
ftp://localhost
远程访问时使用实际ip:  ftp://your_ip

windows下简单有效地访问ftp服务器

1.浏览器
在浏览器中输入ftp://xxx.xx.xx

2.使用文件传输软件(比如8uftp)

推荐您阅读更多有关于“”的文章

猜你喜欢

网站分类
关注电脑博士
友情链接

分享:

支付宝

微信