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

Q: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可以用本地用户登录

A:

  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服务,否则无法生效!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值