ahoppin wrote:Using adduser, I added a user (let's call him ftpuser) and gave him a password. The user gets added to /etc/passwd and also to /etc/shadow. However, vsftpd won't allow ftpuser to connect, saying the login is incorrect.
May I assume that after using adduser, you have verified that the user can login normally with login, as in the following excerpt from a bash session?
Code: Select all
# mkdir -p /home
# adduser ftpuser
Changing password for ftpuser
New password:
Retype password:
Password for ftpuser changed by root
# login ftpuser
Password:
# whoami
ftpuser
#
I am unfamiliar with vsftpd, so can't help you there. But I may be able to clear up a bit of confusion about sudo.
Not just anyone can use sudo. In order to use sudo, a user should be listed in the /etc/sudoers file, or should be a member of a group that is listed in the /etc/sudoers file.
For instance, various Puppies have a sudoers file that contains this line:
Code: Select all
%users ALL=(ALL) ALL, NOPASSWD: SHUTDOWN, SYSTEM
This line says that all members of the group named "users" may run any command on any host as any user. (Note that the
% character indicates that "users" is the name of a group, not the name of a user.) Also, all members of the "users" group may run certain commands without supplying a password; those commands were previously defined with a couple of Cmnd_Alias entries.
If your sudoers file has that line, giving permission to your new user to run sudo may be as easy as adding her to the group named "users":
(Of course, that's just an example. Since the "users" group probably has access to more than an ftp user really needs, you may want to simply add ftpuser to the sudoers file as a user, or as a member a group with fewer privileges.)
Also be aware that the password expected by sudo might not be the password of the user that is invoking sudo or the password of the user indicated by sudo's
-u option. Although by default sudo
does expect the password of the user that invokes it, it may want the password of the user specified by sudo's
-u parameter, the password of the user defined by the runas_default option (normally root), or the password of root, if one of the targetpw, runaspw, or rootpw flags, respectively, is set in the sudoers file for the user that is invoking sudo.
(Oddly, looking at some recent Puppies and one not-so-recent Puppy (slacko-5.5-PAE, precise-5.5, precise-5.6, wheezy-3.5.2.5, and racy-5.2.2) I find this line:
Code: Select all
Defaults:users runaspw, passwd_tries=1
Probably the intention was to set the runaspw flag for all members of the "users" group, but the line has a typo: it is missing the leading
% character for the group name. So it only sets the runaspw flag for a non-existent user named "users".)
For more details see the man page for sudoers.