Operating System - HP-UX
1834462 Members
2805 Online
110067 Solutions
New Discussion

ftpd: FTP LOGIN REFUSED (bad shell)

 
SOLVED
Go to solution
Edwin R. Rivera_1
Occasional Advisor

ftpd: FTP LOGIN REFUSED (bad shell)

hello again,

now that i got ksh back after a "fat fingers" incident, i may as well post the "root of the problem" that i was trying to resolve. i have a linux box running ypserv as the master server for my network. my hp boxes are nis clients and are getting the host, passwd, netgroup maps from the master.

i can log in and out of each box, however, whenever i try ftp, i get the following error in /var/adm/syslog/syslog.log:

....FTP LOGIN REFUSED (bad shell)..etc...

i thought this was happening b/c in my passwd map, i have the login shells set to /bin/ksh (which is where most of the boxes on my network have ksh). however, i'm noticing now that /bin is a symlink to /usr/bin on my hp boxes.

has anyone else experienced this? does ftpd not like symlinking? again, thanks in advance for your assistance.

regards,

edwin "fingers on a diet" rivera
5 REPLIES 5
Patrick Wallek
Honored Contributor
Solution

Re: ftpd: FTP LOGIN REFUSED (bad shell)

Make sure that all shells that you use with ftp are in the /etc/shells file. Here is an example:

# cat /etc/shells
/bin/csh
/usr/bin/csh
/bin/ksh
/usr/bin/ksh
/sbin/sh
/sbin/ksh
linuxfan
Honored Contributor

Re: ftpd: FTP LOGIN REFUSED (bad shell)

Hi Edwin,

I just answered your question in the other thread but rksh and ksh have the same inode and i believe they behave differently based on how they are invoked.

As far as getting bad shell for ftp, make sure the shell of the user you are logging in as is defined in /etc/shells.
Eg: if /bin/ksh is the shell the user is loggin in as make sure /etc/shells contains /bin/ksh.

I normally add /bin/sh,/sbin/sh,/bin/ksh and /bin/posix/sh as well to the /etc/shells

-Ramesh
They think they know but don't. At least I know I don't know - Socrates
Edwin R. Rivera_1
Occasional Advisor

Re: ftpd: FTP LOGIN REFUSED (bad shell)

you're the man patrick. i guess that's why you have that crown by your name.

i didn't know HP-UX used /etc/shells. i had to create the file and populate it. works like a charm now.

gracias,

edwin
Edwin R. Rivera_1
Occasional Advisor

Re: ftpd: FTP LOGIN REFUSED (bad shell)

thanks to you also ramesh. much appreciated amigo.

-edwin
James R. Ferguson
Acclaimed Contributor

Re: ftpd: FTP LOGIN REFUSED (bad shell)

Hi Edwin:

The /bin directory is a holdover from HP-UX pre-10.x filesystems. It is actually a "transition" link to /usr/bin. In the strictest sense, it should not be used. Instead, one should specify /usr/bin. The same is true for the transition link /lib which points to /usr/lib.

In the absence of /etc/shells, valid login shells default to the following list:

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

If you specify /usr/bin/ksh [preferred over /bin/ksh] I think your problem will disappear.

...JRF...