[LINUX] If FTP doesn't connect, check the user's login shell and / etc / shells

When I built the server for business the other day, I got stuck with the introduction of FTP, so I will write it down as a memorandum.

Server environment

CentOS8 proftpd

FTP doesn't connect!

I connected to the server with SSH and installed proftpd with dnf.

When I created an account for FTP and tried to connect from Filezilla, login failed.

FTP is allowed in the firewall settings, and port 21 is open.

I turned off the firewall and tried an FTP connection, but login failed again.

I uninstalled proftpd and installed vsftpd, but this also failed to log in.

I thought it was useless because I installed it via dnf, and even if I built it from the source of proftpd, login failed.

After touching the FTP configuration file and repeatedly installing and uninstalling for more than half a day

When I checked the permissions of the user's login shell, it was / bin / false.

less /etc/passwd

/ bin / false seems to refuse FTP connection.

So change the user's login shell.


usermod -s /sbin/nologin hogehoge_user

Also check / etc / shells to see if / sbin / nologin is registered.

less /etc/shells

If there is no description of / sbin / nologin, add it.

/etc/shells


/bin/sh
/bin/bash
/bin/rbash
/bin/dash
/sbin/nologin

In my case, the FTP connection is now possible.

I hope it helps those who are in the same situation as me.

Reference URL

https://littlebuddha.hatenadiary.org/entry/20090805/1249457771 https://qiita.com/Marukaziler/items/51da64b8935444c1d9e7

Recommended Posts

If FTP doesn't connect, check the user's login shell and / etc / shells
Shells and shell scripts