1834343 Members
2304 Online
110066 Solutions
New Discussion

FTP access

 

FTP access

Does anyone know how setting a user up in SAM in HPUX 11 gives ftp access to the user, but setting up a user from the commandline does not.

I have checked for any differences in the passwd file - there are none. There is also nothing in the ftpusers having any effect on it.

I tried to find out what SAM was doing in the samlog but I gave up after half an hour ....

If anyone can offer any ideas on this I would greatly appreciate it.

Thanks in advance.
7 REPLIES 7
Santosh Nair_1
Honored Contributor

Re: FTP access

The only thing you really need to do to set up a user with ftp access is to make sure that the user has a valid shell as defined by /etc/shells. Not sure if this will help in your situation though.

-Santosh
Life is what's happening while you're busy making other plans
harry d brown jr
Honored Contributor

Re: FTP access

Did you check the file /var/adm/inetd.sec?? Also, what commands are you using at the commandline to add a new user?
Live Free or Die
Christopher McCray_1
Honored Contributor

Re: FTP access

Another possibility, if you are using it, is to make sure the user's ip address is in the /etc/hosts.allow file. Other than that, I'm boggled at this time.

Good luck,
Chris
It wasn't me!!!!
David Lodge
Trusted Contributor

Re: FTP access

I'm confused about what your question is asking; do you want to:

* know how to set up an ftp only user
* describing a problem with a user not being able to access ftp?

If the first you need to examine the ftpaccess file.

If the second you need to check a number of files:
1) Check that user *isn't* in ftpusers
2) Check that the users shell is in /etc/shells (if you don't add the -s switch you'll get /bin/sh as the users shell)
3) If used, check whether ftpaccess allows access to that user...

dave
Joseph C. Denman
Honored Contributor

Re: FTP access

As most above has stated, you need to be a little more specific in your question. What options are you using in the useradd command? By default, a user created on the system will have ftp access as long as the user has a valid shell in the /etc/shells file and is not in the /etc/ftpd/ftpusers file.

If you would provide more input, I'm sure we can help.

...jcd...
If I had only read the instructions first??
Wodisch
Honored Contributor

Re: FTP access

Hello MArk,

you want to an user account who can ftp "in" from the outside, but not login, right?
Then add the "/bin/false" to your "/etc/shells", and give that user "/bin/false" as his shell.
That's it!

HTH,
Wodisch
someone_4
Honored Contributor

Re: FTP access

Problem Description

How do I configure the new ftpd at HP-UX 11.0 to chroot on certain users?

Configuration Info

Operating System - HP-UX
Version - 64-bit 11.0
Hardware System - HP9000
Series - V2250

Solution

Use this procedure to configure the new ftpd:

Note: A user will not have the ability to travel anywhere outside
of his home directory on the system. Setting up a bogus
shell with exit 0 as the contents will cause the connection
of a user to be immediately terminated if the user attempts
to telnet into the system.

1. Configure the ftpaccess file:

a. cd /etc/ftpd

b. cp -p /usr/newconfig/etc/ftpd/ftpaccess .

c. vi ftpaccess. At the bottom of the file there is a guestgroup
directive 'guestgroup ftponly'.

i. Either change that group designation to one you already
have or keep that designation.

ii. If you are keeping the ftponly group, then create that
group on your system.


2. Modify the /etc/inetd.conf file to enable the use of the ftpaccess
file:

a. vi /etc/inetd.conf

b. Add the -a flag to the ftp daemon.

c. ftp stream tcp nowait root /usr/lbin/ftpd ftpd -a -l

4. Make inetd re-read its configuration:

inetd -c

5. Create a bogus shell for users that will only have FTP access to
the system:

a. vi /usr/bin/ftpshell

b. exit 0

c. chmod 555 /usr/bin/ftpshell

d. chown bin:bin /usr/bin/ftpshell

6. Create an /etc/shells file:

a. vi /etc/shells

b. Include these lines in the file:

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

7. Now add a user to the system. Use a group that is 'ftponly' and
make the user's shell /usr/bin/ftpshell.

8. Use SAM to limit the user to his home directory by setting up the
directory in this form:

/home/username/./

Note: The /./ is the important key here. When the ftpd verifies a
user's login, it checks and sees that the user is a member of
the 'guestgroup' ftponly. It then examines the home directory
and, if it sees a /./ in the path, it will then perform a chroot
to that directory. Therefore, when that user FTPs into the
system, their home directory will appear as the / directory.

9. Provide the user with an ls command:

a. cd /home/username

b. mkdir usr

c. mkdir usr/bin

d. cp -p /sbin/ls usr/bin

e. chown -R bin:bin usr

f. chmod -R 555 usr