1831043 Members
2399 Online
110019 Solutions
New Discussion

Re: ftp question

 
Javier Ortiz Guajardo
Frequent Advisor

ftp question

i have a user in the passwd and his shell is /bin/sh. i want to to connect to the system with ftp and i receive the message access denied. I change the shell user in passwd with /usr/bin/sh then and i can connect to ftp qwth no problem.

What´s the diference between use /usr/bin/sh and /bin/sh?

Why ftp did not work with /bin/sh ?

i don´t find information about the restriction of ftp using /sin/sh.

i hope do you undertand the question.

than
The obstacles are those things that the people see when they left to see their goals.
10 REPLIES 10
Robert-Jan Goossens
Honored Contributor

Re: ftp question

Hi Javier,

Check the file

# cat /etc/shells

add the shells you would like to use for your user.

Hope this helps,
Robert-Jan
Patrick Wallek
Honored Contributor

Re: ftp question

You most likely do not have /sbin/sh listed in the /etc/shells file.

If it is not there, then you will not be able to use FTP.

Muthukumar_5
Honored Contributor

Re: ftp question

Shell location problem may be making this problem here.

can /etc/shells

whereis sh
based on this, try to to set on /etc/passwd file.

use vipw / vi to edit the shell or chsh command to change shell.
Easy to suggest when don't know about the problem!
Javier Ortiz Guajardo
Frequent Advisor

Re: ftp question

i have HP-UX 11.0, and the file /etc/shell is not found.

The man ftpd said this
ftpd authenticates users according to three rules:
+ The user must have a standard shell returned by getusershell().

Wich one is the standar shell /usr/bin/sh or /bin/sh? and Why?

Maybe, i´m requesting too much..thank....so much
The obstacles are those things that the people see when they left to see their goals.
Robert-Jan Goossens
Honored Contributor

Re: ftp question

/etc/shells

# ls -la /etc/shells
-rw-r--r-- 1 root sys 96 Aug 21 2003 /etc/shells

most commen used are the:
/sbin/sh for root (usr is not mounted in single user mode)

for normal users:
/usr/bin/sh
/usr/bin/ksh
/usr/bin/csh

Best regards,
Robert-Jan

Ps, No you are not requesting to mutch
Sanjay_6
Honored Contributor

Re: ftp question

Hi,

check and see if you a /etc/shells file. There is a possibility /etc/shells file exist and /usr/bin/sh is there, whereas /bin/sh is not available. Add /bin/sh in that file and then try.

Do "man shells" for more info.

Hope this helps.

Regds
Muthukumar_5
Honored Contributor

Re: ftp question

It is shells not shell. You can get information about that file as,

man shells -- man page
cat shells -- contents of that file.

If you set the correct shell path only, user ftp execution on that shell.

whereis sh / locate sh will give location sh
which sh too.

HTH.
Easy to suggest when don't know about the problem!
Javier Ortiz Guajardo
Frequent Advisor

Re: ftp question

how can i do for create the file /etc/shells ?
The obstacles are those things that the people see when they left to see their goals.
Sanjay_6
Honored Contributor

Re: ftp question

Hi,

If you don't have a /etc/shells file, create it using vi,

vi /etc/shells


Add each shells that you are using in a seperate line, save it and exit.

Hope this helps.

Regds
Bill Hassell
Honored Contributor

Re: ftp question

There is no shell called /bin/sh. In fact, there is no directory called /bin (or /lib). These directories were changed more than a decade ago with the industry standard V.4 filesystem layout. Solaris and other Unix flavors are similar. The reason that you can run /bin/sh is that /bin is not a directory but a symbolic link, or in HP-UX terminology, a transition link. The symlink makes all the old code continue to work although 10 years is a long time...

There is no /etc/shells file by default in HP-UX. That means that ftpd (the server daemon) will use getusershell to determine the validity of the shell. From the man page for getusershell:

"If /etc/shells does not exist or is not readable, getusershell() returns the following standard system shells:

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

as if they were contained in /etc/shells."

As you can see, /bin/sh is not there. Change all your users to use /usr/bin/sh, the correct location for the POSIX shell. /sbin/sh is also the POSIX shell but with archived libraries so it will also run in single user mode. Otherwise, /sbun/sh and /usr/bin/sh are the same.

NOTE: Every user can change their own shell with the command: chsh as in:

chsh my_login /usr/bin/sh

This command changes the passwd file without using vi.


Bill Hassell, sysadmin