IDC知识库
IDC领域专业知识百科平台

创建ftp服务器无法使用

Linux使用vsftp创建FTP器,安装以及启动都按照网上说的一步一步操作,没有发现问题。但是创建ftp服务器后使用本地用户无法登录使用。

ftp服务器无法用本地用户登录:

[test@client home]$ ftp 192.168.221.129
Connected to 192.168.221.129 (192.168.221.129).
220 (vsFTPd 2.2.2)
Name (192.168.221.129:test): test
331 Please specify the password.
Password:
500 OOPS: cannot change directory:/home/test
Login failed.

//但是lftp可以用本地用户登录
1.检查 是否是vsftp服务器端家目录权限问题?
[root@review1 home]# chmod +r test
[root@review1 home]# ls
test
[root@review1 home]# ll
total 4
drwxr–r–. 2 test test 4096 May 27 10:57 test
再次登录,无效。

2.检查本地用户test是否存在,是否有密码

[root@review1 ~]# tail -5 /etc/passwd
saslauth:x:499:76:”Saslauthd user”:/var/empty/saslauth:/sbin/nologin
postfix:x:89:89::/var/spool/postfix:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
ntp:x:38:38::/etc/ntp:/sbin/nologin
test:x:500:500::/home/test:/bin/bash

[root@review1 ~]# passwd test
Changing password for user test.
New password:
BAD PASSWORD: it is too simplistic/systematic
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
存在,密码正常。

3.检查客户端本地用户是否存在

[root@client ~]# tail -5 /etc/passwd
postfix:x:89:89::/var/spool/postfix:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
test:x:500:500::/home/test:/bin/bash

[root@client ~]# passwd test
Changing password for user test.
New password:
BAD PASSWORD: it is too simplistic/systematic
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
存在,设置正常。再次登录,登录失败!

4.检查、关闭selinux,重新连接,失败。
5. 重启vsftp,再次测试,成功。

[root@mysql ~]# ftp 192.168.221.129
Connected to 192.168.221.129 (192.168.221.129).
220 (vsFTPd 2.2.2)
Name (192.168.221.129:root): test
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.

总结:
用户无法进入家目录,是 因为 SElinux限制了本地ftp用户的访问,需要关闭SELinux,但是关闭后还需要重新启动vsftp服务,否则无法生效!

vps涓绘満
域名频道提供2U大小标准的服务器托管服务,带宽从1M到100M可选。
托管网络设备扩展方便,可以随意增加硬盘和内存,完全自己独立使用,不受其他客户影响。
为客户提供标准的环境配置及初始安全配置服务,在线客服支持。
域名频道独立服务器租用送服务器产权,上海电信机房,超实惠的进入抢购http://www.dns110.com/server/

赞(2)
分享到: 更多 (0)

中国专业的网站域名及网站空间提供商

买域名买空间