Operating System - HP-UX
1826235 Members
3541 Online
109692 Solutions
New Discussion

Re: Can not connect to FTP user after setup anonymous ftp

 
Sonny_8
Occasional Advisor

Can not connect to FTP user after setup anonymous ftp

Hi
I config anonymous ftp following the below, I get from manal, but When I try to connect to ftp user, I cannot login. What I have to verify?
What process have to be run and after that what I have to config more?
Any idea and thought?

Use a text editor to add a line for user ftp to the /etc/passwd file, as in the following example:
ftp:*:500:guest:anonymous ftp:/home/ftp:/usr/bin/false
The password field should be *, the group membership should be guest, and the login shell should be /usr/bin/false. In this example, user ftp's user ID is 500, and the anonymous ftp directory is /home/ftp.
Type man 4 passwd at the HP-UX prompt for information on the passwd file.
To Create the Anonymous ftp Directory

1. Create the ftp home directory that you configured in the /etc/passwd file, as in the following example:

2. cd /home
mkdir ftp
3. Create the subdirectory /usr/bin under the ftp home directory:

4. cd /home/ftp
5. mkdir usr
6. cd usr
mkdir bin
7. Copy the ls and pwd commands from /sbin to ~ftp/usr/bin, and set the permissions on the commands to 0111 (executable only):

8. cp /sbin/ls /home/ftp/usr/bin
9. cp /sbin/pwd /home/ftp/usr/bin
10. chmod 0111 /home/ftp/usr/bin/ls
chmod 0111 /home/ftp/usr/bin/pwd
11. Set the owner of the ~ftp/usr/bin and ~ftp/usr directories to root, and set the permissions to 0555 (not writeable):

12. chown root /home/ftp/usr/bin
13. chmod 0555 /home/ftp/usr/bin
14. chown root /home/ftp/usr
chmod 0555 /home/ftp/usr
15. Create the subdirectory etc under the ftp home directory:

16. cd /home/ftp
mkdir etc
17. Copy /etc/passwd and /etc/group to ~ftp/etc. These files are required by the ls command, to display the owners of files and directories under ~ftp.

18. cp /etc/passwd /home/ftp/etc
cp /etc/group /home/ftp/etc
19. Replace the password field in all entries in /home/ftp/etc/passwd with *, and delete the shell field from the end of each entry:

20. ftp:*:500:guest:anonymous ftp:/home/ftp:
acb:*:8996:20::/home/acb:
21. Replace the password field in all entries in /home/ftp/etc/group with *:

22. users:*:20:acb
guest:*:21:ftp
23. Set the owner of the files in ~ftp/etc to root, and set the permissions to 0444 (read only):

24. chown root /home/ftp/etc/passwd
25. chmod 0444 /home/ftp/etc/passwd
26. chown root /home/ftp/etc/group
chmod 0444 /home/ftp/etc/group
27. Set the owner of ~ftp/etc to root, and set the permissions to 0555 (not writeable):

28. chown root /home/ftp/etc
chmod 0555 /home/ftp/etc
29. Create a directory called pub under ~ftp. Set its owner to user ftp and its permissions to 0777 (writeable by all). Anonymous ftp users can put files in this directory to make them available to other anonymous ftp users.

30. mkdir /home/ftp/pub
31. chown ftp /home/ftp/pub
chmod 0777 /home/ftp/pub
32. Create a directory called dist under ~ftp. Set its owner to user root and its permissions to 0755 (writeable only by root). The superuser can put read-only files in this directory to make them available to anonymous ftp users.

33. mkdir /home/ftp/dist
34. chown root /home/ftp/dist
chmod 0755 /home/ftp/dist
35. Set the owner of user ftp's home directory to root and the permissions to 0555 (not writeable).

36. chown root /home/ftp
chmod 0555 /home/ftp

Regards
Sonny
Timezone id
5 REPLIES 5
Robert-Jan Goossens
Honored Contributor

Re: Can not connect to FTP user after setup anonymous ftp

Hi Sonny,

check your /etc/shells for /usr/bin/false.

Robert-Jan.
Bill Hassell
Honored Contributor

Re: Can not connect to FTP user after setup anonymous ftp

Sorry you had to go through so many steps. If you use SAM, you can enable anonymous ftp for incoming and outgoing in just a couple of steps. Start with the error message: what happens when you enter the user name ftp (or anonymous, either is acceptable)? Does it state that anonymous ftp is allowed or that the user ftp or anonymous is unknown? This message will occur BEFORE asking for the password. If so, run SAM and disable anonymous ftp (in and out). (you'll find anonymous ftp in SAM at:

Networking and Communications ->
Network Services ->
Anonymous FTP

Highlight Anonymous FTP and select the Actions menu item.


Bill Hassell, sysadmin
Sonny_8
Occasional Advisor

Re: Can not connect to FTP user after setup anonymous ftp

Hi
Thanks Robert and Bill

Bill, I try to config with your method, but I am not be able to login.
login: ftp
Passwd:[my machine name right?]

I try with passwd and without passwd to login
can not login or I do somthings wrong?

Any idea would be appreciated


Regards
Sonny
Timezone id
Artyom Voronchihin
Respected Contributor

Re: Can not connect to FTP user after setup anonymous ftp

He-he. You make mistake trying to login as ftp. To access to anonimous FTP you should login as anonymous and type your e-mail address as password. I.e.

# ftp ftp.karelia.ru
Connected to sampo.karelia.ru.
220 sampo-www.karelia.ru FTP server ready.
Name (ftp.karelia.ru:root): anonymous
331 Anonymous login ok, send your complete email address as your password.
Password:
230 Anonymous access granted, restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
"Intel inside" is not a label, it's a warning.
Bill Hassell
Honored Contributor

Re: Can not connect to FTP user after setup anonymous ftp

ftp and anonymous are identical users for all standard versions of ftp including Windows. The password can be simply ftp unless you have configured special requirements in the ftpd config files. Do you have an /etc/shells file? If so, the shell listed for anonymous ftp (username will be ftp) should appear in /etc/shells. From the man page for getusershell:

/sbin/sh
/usr/bin/sh
/usr/bin/rsh
/usr/bin/ksh
/usr/bin/rksh
/usr/bin/csh
/usr/bin/keysh

Creat /etc/shells with this list (the default if /etc/shells does not exist) and add /usr/bin/false as a valid shell. And most important, edit /etc/inetd.conf to add the -l option to ftpd as in:

ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l

and run inetd -c to reread the conf file. That should log the reason for the failure. mYou inidcated that you did a login and it asked for a password. If anonymous was not enabled, ftpd would not have asked for a password. Post the syslog results once you have ftpd -l -v turned on in inetd.conf


Bill Hassell, sysadmin