设为首页 收藏本站
查看: 1060|回复: 0

[经验分享] liunx FTP 配置 与相关问题

[复制链接]

尚未签到

发表于 2016-6-9 12:43:02 | 显示全部楼层 |阅读模式
  




 [iyunv@www ~]#yum -y install vsftpd
[iyunv@www ~]#vi /etc/vsftpd/vsftpd.conf

# line 12: no anonymous

anonymous_enable=NO

# line 80,81: uncomment ( allow ascii mode )

ascii_upload_enable=YES
ascii_download_enable=YES
# line 95, 96: uncomment ( enable chroot )

chroot_local_user=YES
chroot_list_enable=YES
# line 98: uncomment ( specify chroot list )

chroot_list_file=/etc/vsftpd/chroot_list
# line 104: uncomment

ls_recurse_enable=YES
# add at the last line

# specify root directory ( if don't specify, users' home directory become FTP home directory)

local_root=public_html

# use localtime

use_localtime=YES

[iyunv@www ~]#vi /etc/vsftpd/chroot_list

# add users you allow to move over their home directory

cent

[iyunv@www ~]#/etc/rc.d/init.d/vsftpd start

Starting vsftpd for vsftpd:[  OK  ]

[iyunv@www ~]#chkconfig vsftpd on
 
 
1、添加用户,首先用adduser命令添加一个普通用户,命令如下:#adduser tommy
//添加一个名为tommy的用户
#passwd tommy   //修改密码
Changing password for user tommy.
New UNIX password:     //在这里输入新密码
Retype new UNIX password:  //再次输入新密码
passwd: all authentication tokens updated successfully.
2、赋予root权限
方法一: 修改/etc/sudoers 文件,找到下面一行,把前面的注释(#)去掉
## Allows people in group wheel to run all commands
%wheel    ALL=(ALL)    ALL
然后修改用户,使其属于root组(wheel),命令如下:
#usermod -g root tommy
修改完毕,现在可以用tommy帐号登录,然后用命令su – ,即可获得root权限进行操作。
方法二: 修改/etc/sudoers 文件,找到下面一行,在root下面添加一行,如下所示:
## Allow root to run any commands anywhere
root    ALL=(ALL)     ALL
tommy   ALL=(ALL)     ALL
修改完毕,现在可以用tommy帐号登录,然后用命令su – ,即可获得root权限进行操作。
方法三: 修改/etc/passwd 文件,找到如下行,把用户ID修改为0 ,如下所示:
tommy:x:500:500:tommy:/home/tommy:/bin/bash
修改后如下
tommy:x:0:500:tommy:/home/tommy:/bin/bash
保存,用tommy账户登录后,直接获取的就是root帐号的权限。
友情提醒:虽然方法三看上去简单方便,但一般不推荐使用,推荐使用方法二。
 
vsftpd dead , but subsys locked –解除方法汇总(Red Hat Enterprise Linux 4)

vsftpd dead , but subsys locked –解除方法汇总(Red Hat Enterprise Linux 4)
系统: RHEL4
ftp软件:vsftpd 2.**** , 与 xinetd 分离运行.
状态: 执行用service vsftpd status ->vsftpd dead, but subsys locked ,重新安装vsftp,结果依旧.
1. 先删除 /var/lock/subsys/vsftpd -> rm -frv  /var/lock/subsys/vsftpd
2.  以下几种可能的解决方法(或者关系)
a.  仔细检查/etc/vsftpd/vsftpd.conf的配置文件的内容格式.确定正确,主要是全角半角字符的编码错误.
b.  确认                listen=YES       TCP_trappers=YES
c. cp /etc/vsftpd/vsftpd.conf    /etc/vsftpd/vsftpd.conf.bak   \  rm -f /etc/vsftpd/vsftpd.conf
cp /etc/vsftpd/vsftpd.conf .bak   /etc/vsftpd/vsftpd.conf    \ rm -f   /etc/vsftpd/vsftpd.conf.bak
说明:cp 和mv命令对selinux security context影响  cp将拷贝过去的文件的context改变为目的目录的context,而mv则不会改变移动文件的context
(I’vehad problems like this before, and I finally found out what the problemwas. When you ‘mv’ a file (like a config file from a home dir to the proper location) it keeps the selinux context setting from the originating directory. When you ‘cp’ a file, it will change that contextto the context of the directory being moved too. I have mv’d backups ofconfigs from home dir to /etc and ran into the same error message. If you do a fixfiles relabel, or touch /.autorelabel and reboot, it should re-write the security context and hopefully clear up your problems.)
d. 关闭 xinetd 服务, 先启动 vsftpd, 再启动xinetd .  (删除gssftp)







运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-228270-1-1.html 上篇帖子: 用apache FTP client实现FTP客户端--支持断点续传和中文文件(转) 下篇帖子: Java Socket 模拟 Ftp Server/Client
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表