1826420 Members
3082 Online
109692 Solutions
New Discussion

Re: FTP Access

 
Sarwan
Frequent Advisor

FTP Access

Hi Experts, I have to enable to ftp access to user, He has raised an ticket for that. I am able to access the server via ftp.
===============================================
When i go to /etc/ftpd i find two directories.
#cd /etc/ftpd
#ls -l
dr-xr-xr-x 2 bin bin Mar 8 2004 ftp-exec
dr-xr--r-- 2 bin bin Mar 8 2004 pids
===============================================
Please let me know the steps that i need to follow
10 REPLIES 10
Ganesan R
Honored Contributor

Re: FTP Access

Hi Sarwan,

By default ftp access will be given to all the users except the users listed in /etc/ftpd/ftpusers file. So make sure that the user name is not listed in /etc/ftpd/ftpusers file.

Also make sure that the user shell is listed in /etc/shells file.

No need to do anything else.

If you get any errors when the user do ftp post it.
Best wishes,

Ganesh.
Ganesan R
Honored Contributor

Re: FTP Access

Hi again,

For more clarity, these are the points you need to check.1. Verify .netrc in the user's home directory.
If the .netrc file contains password or account information for use
other than for anonymous ftp, its owner must match the effective
user ID of the current process. Its read, write, and execute
permission bits for group and other must all be zero, and it must
be readable by its owner. Otherwise, the file is ignored.

So if you are unsure about this file, rename it to .netrc.old for
troubleshooting purposes.

2. Check /etc/ftpd/ftpusers.
ftpd rejects remote logins to local user accounts that are named
in /etc/ftpd/ftpusers. Each restricted account name must appear
alone on a line in the file. The line cannot contain any white
space.

User accounts that specify a restricted login shell in /etc/passwd
should be listed in /etc/ftpd/ftpusers because ftpd accesses local
accounts without using their login shells.

3. You need to add or verify /etc/shells.

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

All shells referred to in /etc/passwd or in the NIS passwd map should be valid shells or links on this system and be listed in
/etc/shells.


Also confirm if any special character are there in the user password...

Best wishes,

Ganesh.
Sarwan
Frequent Advisor

Re: FTP Access

Hi Ganeshan,
thanks for your reply.
When i check there is no /etc/ftpd/ftpuser file,
i am able to do ftp to that server as a root

Sarwan
Frequent Advisor

Re: FTP Access

This is a HP-UX 11.23 and i don't see any file or directory as /etc/shell also
Ganesan R
Honored Contributor

Re: FTP Access

Hi Sarwan,

>>>When i check there is no /etc/ftpd/ftpuser file<<<

Note the file name is "/etc/ftpd/ftpusers" not "/etc/ftpd/ftpuser"

Have you tried to ftp as that user? if so what is the error you are getting?
Best wishes,

Ganesh.
Sarwan
Frequent Advisor

Re: FTP Access

no that was a typo error from my side but the file doesn't exists

root# more /etc/ftpd/ftpusers
/etc/ftpd/ftpusers: No such file or directory
Ganesan R
Honored Contributor

Re: FTP Access

Hi Sarwan,

Then the user should be able to ftp. Can you post the error if the user gets any?
Best wishes,

Ganesh.
Sarwan
Frequent Advisor

Re: FTP Access

Hi Ganesh, I found the issue. When i spoke with user he said he got an password error. It was not anything to do with system configuration. I created a test ID and tried it was working fine. changed users passwd and tried but was not working. Changed users shell from /bin/ksh to /usr/bin/ksh. Now it was fine.
Dennis Handly
Acclaimed Contributor

Re: FTP Access

>Changed users shell from /bin/ksh to /usr/bin/ksh.

You can also put these other shell paths into /etc/shells. See shells(4).
Matti_Kurkela
Honored Contributor

Re: FTP Access

That's it. If the user's shell does not *exactly* match one of the lines in /etc/shells, ftpd will deny access for that user.

If /etc/shells does not exist, the standard default list (documented in "man getusershell") is used instead:

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

Yes, /bin/ksh refers to the same file as /usr/bin/ksh on HP-UX. The ftpd does not care: if it does not find a matching string in /etc/shells (or in the default list), the user is denied access.

MK
MK