nassh: SSHv2 Server Example Application

This application demonstrates the SSHv2 server API. The SSH server uses
RSA or DSA private keys to communicate with client.  The application runs
on all platforms. 

There are two ways to run this example application.  If you run the application
without the file system, the application uses the example keys in root.c.

If you run the application with the file system, you must make the following
changes to the BSP:

1) In netos/src/bsp/platforms/xxx/bsp_fs.h, set
BSP_INCLUDE_FILESYSTEM_FOR_CLIBRARY to TRUE. This change creates a RAM and 
Flash file system volume by default and allows using the C library file I/O 
API functions to access the file system services.

2) Rebuild the BSP.

3) Rebuild the application.


What this application does?

1. Starts FTP server to allow user to upload host private keys
2. Prompts user if the required certificate is not available in the flash
   file system volume.  This step occurs if the file system is enabled.
   These key files are in netos\src\examples\nasslsvr\keys or
   netos\src\examples\nasslclient\keys.  
3. Waits for user to download the requested file via FTP 
     (user:user and password:password)
4. Starts SSH server which accepts connection on port 22
5. Serves up command line shells to connected clients

Application results can be obtained using an SSHv2 client,
such as the OpenSSH project's (www.openssh.org) ssh client application.


You can use the following sample SSH command line to connect to the SSH
server on the target board:

ssh -l root <ip address>


If you see the following message 

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
dc:65:5f:d6:3c:4d:f9:61:f3:16:53:e4:1a:29:ce:52.
Please contact your system administrator.
Add correct host key in /cygdrive/c/Documents and Settings/XXX/.ssh/known_host
s to get rid of this message.
Offending key in /cygdrive/c/Documents and Settings/jwang/.ssh/known_hosts:5
RSA host key for 10.52.35.86 has changed and you have requested strict checking.
 
Host key verification failed.

it means that there is already an SSH key stored for this host, and the key
that was presented does not match the one that was stored from a previous
session.  Simply rename this file to make the SSH command line work properly.

In case backspace doesn't work then you can either use cntrl-h instead of 
backspace or configure the terminal emulator to send cntrl-h when backspace 
is pressed.  

Following files are provided in this example.

appconf.h         sets application configuration settings
init.h            contains defines for certificates name and pass phrase
makefile          makefile for the GNU toolset.
readme            this file
root.c            contains applicationStart() function, that starts FTP server
                  and SSH server
naftpapp.c        used to start FTP server
src\fs_intf\ftpsvrfs.c   for file system related APIs

In addition, the following files in the BSP directory are built
as part of this application.

reset.s         contains the reset code
appconf_api.c   contains code used to read settings in appconf.h

The application build file links in the following libraries.

libbsp.a           		contains the BSP code
libtcpip.a         		contains the Net+Works TCP/IP stack
libtx.a            		contains the ThreadX kernel
libfilesys.a       		contains the file system libraries
libposix.a         		contains the POSIX layer libraries
libflash.a         		contains the Flash driver API library
libftpsvr.a        		contains the FTP server library
libtelnsvr.a       		contains the Telnet server library
libaddp.a		   		contains the ADDP Library
libssh.a		   		contains the SSH Library
libmanapi.a        		contains the NET+Works Management API library.
libfat32.a             	contains the FAT32 library
libsntp.a				contains the SNTP API Library
libcrypto.a 			contains the Crypto Library
libdnsclnt.a        	contains the DNS Client library
libnarmapi.a

The application uses the following files located in the
netos\src\bsp\platforms\<platform> directory.

bootldr.dat     bootloader configuration file used to generate the
                file image.bin.  It controls the information placed
                in the bootloader header of the image.

image.ldr       GNU linker script used to build an image that can
                be debugged and used with the bootloader.
                
customize.ldr   Customizable GNU linker script

