LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Proftp - logging in with a user except root. How to? (https://www.linuxquestions.org/questions/linux-server-73/proftp-logging-in-with-a-user-except-root-how-to-624972/)

Seregwethrin 03-01-2008 12:29 PM

[Solved] Proftp - logging in with a user except root. How to?
 
Hello;

I've a /www directory and 4-5 sites at there. /www/xxx.com /www/xxx.net etc...

I did a "chown -R /www ftp:web"

I've set user "ftp"'s home directory as /www
I've set a password for user "ftp"

I can login with root user. But i can't login any other users.

What can i do for logging in with ftp user?

I've searched but i can't find any useful information.

I'm using proftpd.

MS3FGX 03-02-2008 07:35 AM

Check that the ftp user is not disabled in the first place. Some distributions include the ftp user but leave it disabled, so that you need to manually enable anonymous FTP (with the assumption being that anon FTP is not what most people will want by default).

Check the file /etc/ftpusers and see what names are listed. Those are the names of the users who cannot use FTP. It would be a good idea to put root into this list, by the way, as logging in as root remotely is a bad idea with any protocol.

Failing that, check the proftpd logs when you try and log in with a non-root user. It should give you an error message in the logs which you can use to start troubleshooting.

Seregwethrin 03-03-2008 06:30 AM

No, ftp user is not disabled. It is not at the ftpusers file.

I know logging with root is a bad idea but i can't login any other user.

Anon ftp is disabled at my proftpd conf. I know that anon ftp is different than what i want. Do i know wrong? Do i have to enable anon ftp?

MS3FGX 03-03-2008 11:00 AM

Anonymous FTP is generally linked to the "ftp" user, so disabling it in your ProFTPd configuration would stop that user from logging in.

Seregwethrin 03-06-2008 06:40 AM

This post's problem is solved.

Seregwethrin 03-06-2008 08:04 AM

Okay i set the config file for logs. It gives general "wrong password" error.

Code:

server.xxx.com [11556] ::ffff:(MY IP) [06/Mar/2008:15:33:08 +0200] "USER ftpuser" 331
server.xxx.com [11556] ::ffff:(MY IP) [06/Mar/2008:15:33:11 +0200] "PASS (hidden)" 530

And i found something strange. All users can't login, except root. Root user can login if the pam config set and if the mod_auth_pam set as first auth order. If not, root user can't login too.

Code:

# Use pam to authenticate (default) and be authoritative
AuthPAMConfig                  proftpd
AuthOrder                      mod_auth_pam.c* mod_auth_unix.c

If mod_auth_linux first, root user can't login. If mod_auth_pam removed, root user can't login. But logging anonymously with any user is working great (home dirs vs..)

/etc/pam.d/proftpd
Code:

#%PAM-1.0
auth      required    pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
auth      required    pam_stack.so service=system-auth
auth      required    pam_shells.so
account    required    pam_stack.so service=system-auth
session    required    pam_stack.so service=system-auth

Also there's no user at /etc/ftpusers, which i want to use at ftp.

What can i do? Do you have an idea? I don't know much about PAM.

Seregwethrin 03-09-2008 05:01 AM

also i looked at /etc/shadow
root user's password looks encrypted but ftpuser's password not encrypted.

Can anyone help me please?

Edit: okay i tried to overwrite the root's encrypted password to ftpuser's password at /etc/shadow and i can login with ftpuser now with root's password.

How can i encrypt user passwords at /etc/shadow? That is the problem for me now.

Seregwethrin 03-09-2008 05:17 AM

Okay okay i solved the problem.

I was updating password like usermod -p passwod ftpuser

Now i updated passwords with passwod command. And it works great :)

Thanks for reading all. The happy end :)


All times are GMT -5. The time now is 02:52 PM.