Operating System - HP-UX
1820117 Members
3060 Online
109619 Solutions
New Discussion юеВ

Re: FTP---- Which shell use?

 
leereg_5
Frequent Advisor

FTP---- Which shell use?

Normally to make use of FTP sevice, we need to create the file /etc/shells and add some paths of shells to it.
My question:

How to find out the default shell defined by the ftp server?

Thanks in advance!
Always UNIX!
10 REPLIES 10
Michael Tully
Honored Contributor

Re: FTP---- Which shell use?

Hi,

By default the ftp server generates a shell
based on /usr/bin/sh.

Check out the man page on 'ftp' for further
information.

HTH
-Michael
Anyone for a Mutiny ?
leereg_5
Frequent Advisor

Re: FTP---- Which shell use?

Where is the configuration file and how to change the default value?
Always UNIX!
Michael Tully
Honored Contributor

Re: FTP---- Which shell use?

Hi,

Depending on what options you use with 'ftp' you can also use 'csh'. Have a look at the man page for the 'chsh' command. This utility has the ability to change the shell.

Regards
-Michael
Anyone for a Mutiny ?
linuxfan
Honored Contributor

Re: FTP---- Which shell use?

Hi,

man 4 shells tells us that /etc/shells is basically a file which lists all the shells in the system. When a user ftps using a shell not listed in the /etc/shells then ftp access is denied.

If you are referring to the shell which is invoked when you run !cmd within a ftp session, then by default ftp starts up /usr/bin/sh if $SHELL is undefined.

-HTH
I am Ru
They think they know but don't. At least I know I don't know - Socrates
leereg_5
Frequent Advisor

Re: FTP---- Which shell use?

Thanks for your input.
I have made a trial:
First I was rejected when my default shell is /bin/ksh
when I changed my shell to /usr/bin/ksh, I can perform ftp to that HP server.

surely I did not create the file /etc/shells.

Who defined the shell /usr/bin/ksh?
Always UNIX!
Michael Tully
Honored Contributor

Re: FTP---- Which shell use?

Hi,

In the password file all shells have a full
path. i.e. /usr/bin/sh /usr/bin/ksh etc.
that's why your first attempt was rejected as
an incorrect shell. You don't need to create
a /etc/shells file unless you wish to restrict
some of the shells being used on your system.
The /usr/bin/ksh shell comes from the password
file. e.g.

informix:bqQwdeywfzkuc:220:200:Informix User,,,:/home/informix:/usr/bin/ksh

Hope this explains things
Michael
Anyone for a Mutiny ?
leereg_5
Frequent Advisor

Re: FTP---- Which shell use?

Hi Michael:
When I was rejected, I had a line:myname:x:20142:1200::/home/myname:/bin/ksh

in /etc/passwd file. when I change that line to :
ricklee:x:20142:1200:Rick,Lee:/home/ricklee:/usr/bin/ksh
I got it.
I mean in the destinated box, which file define the ftp user make use of /usr/bin/ksh
but no others?
How to change it if I want to perf?


Thanks a lot!
Always UNIX!
Michael Tully
Honored Contributor

Re: FTP---- Which shell use?

Hi,

If you have a look you will see that the
correct path to the shells is /usr/bin/ksh
etc.
The default shell for this user should be
/usr/bin/ksh if that is the shell defined
in /etc/passwd.

Anyone for a Mutiny ?
James R. Ferguson
Acclaimed Contributor

Re: FTP---- Which shell use?

Hi:

The standard system shells are documented in section-3 of the man pages. If you look at 'man 3 getusershell' you will find that if /etc/shells doesn't exist or isn't readable, then '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

Regards!

...JRF...
Carlos Fernandez Riera
Honored Contributor

Re: FTP---- Which shell use?


From man ftpd:



ftpd authenticates users according to three rules:

+ The user name must be in the password data base, /etc/passwd,
and not have a null password. The client must provide the
correct password for the user before any file operations can
be performed.

+ The user name must not appear in the file /etc/ftpd/ftpusers
(see ftpusers(4)).

+ The user must have a standard shell returned by
getusershell().





See man ftpd and getusershell.
Regards.




unsupported