ssh compile and install --

History:

  • Version: 0.4 Sat 13 February 1999 20:00:12
  • Version: 0.3 Wed 25 February 1998 20:50:49
  • Version: 0.2 Thu, 15. January 1998 16:12:52
  • Version: 0.1 Tue Sep 23 13:20:06 MET DST 1997
  • Covered Systems: IRIX-6.x, SINIX-5.43, Solaris-2.5.1

Porting notes

Non default switches/defines are marked red.

Solaris 2.x

Ssh should compile out of the box (at least with gcc).

Porting notes for Openssh on Solaris can be found here

IRIX-6.x

There is a nasty bug in the ssh source code tree that was introduced as a patch against the ssh-1.2.23 code base. Here is the announcement.

From: Eivind Gjelseth <eivind@ii.uib.no>
To: Tero Kivinen <kivinen@ssh.fi>
cc: ssh@clinet.fi
Subject: Ssh 1.2.23 -- patch for project accounting on SGI

[-- Attachment #1 --]
[-- Type: text/PLAIN, Encoding: 7bit, Size: 4.3K --]

I have made a patch to do project accounting on SGI. I have patched
config.h.in, configure.in and sshd.c to automatic detect
/usr/include/proj.h on IRIX-6.x and set's the variable HAVE_SGI_PROJ_H.

1.2.26 adds SGI project accounting. I.e. Autoconf checks for IRIX and the compile will default to use SGI
project accounting and will terminate the connection if the user cannot be found in /etc/projects.

The getprojuser system call fails. SGI project setup fails, and you are promptly disconnected.

This happens if you don't have the /etc/project and /etc/projectid files set up.

/etc/project should look like:

root:sysadm,genuser,batchuser
myusername:genuser,batchuser

/etc/projid

sysadm:1
genuser:2
The code is in sshd.c
  3663 #ifdef HAVE_SGI_PROJ_H
   3664 /*
   3665  On a SGI, set the account number for the current process to the user's
   3666  default account. If this is not done, the process will have an account
   3667  of zero and accounting will not operate correctly.
   3668
   3669  Eivind Gjelseth
   3670  Para//ab, High Performance Computing Centre
   3671  eivind@ii.uib.no
   3672
   3673 */
   3674 int sgi_project_setup(char *username)
   3675 {
   3676   int err;
   3677   int naccts;
   3678   projid_t pbuf;
   3679
   3680   /* Find default project for a particular user */
   3681   if ((naccts = getprojuser(username, &pbuf, 1)) < 0)
   3682     {
   3683       debug("System call getprojuser failed");
   3684       return(-1);
   3685     }
   3686
   3687   /* Create a new array session and moves the current
   3688      process from its original array session to the new one. */
   3689   if (newarraysess() < 0)
   3690     {
   3691       debug("System call newarraysess failure");
   3692       return(-1);
   3693     }
   3694
   3695   /* Change the project ID for the array session. */
   3696   /* Must be changed after the new array session has been created. */
   3697   if (naccts)
   3698     err = setprid(pbuf.proj_id);
   3699
   3700   if (err != 0)
   3701     {
   3702       debug("System call setprid failure");
   3703       return(-1);
   3704     }
   3705
   3706   return(0);
   3707 }
   3708 #endif /* HAVE_SGI_PROJ_H */


If you don't want to set up project accounting on your SGI run configure.
Comment out this line in config.h after having run configure and recompile everything:

/* #define HAVE_SGI_PROJ_H 1 */

Should work then.

SINIX-5.4x

Configure is not able to recognize that the gettimeofday() function does not accept the TZ argument on SINIX. Therefore you need to put the define statement HAVE_NO_TZ_IN_GETTIMEOFDAY in the top level Makefile.

  • DEFS = -DHAVE_CONFIG_H -DHAVE_NO_TZ_IN_GETTIMEOFDAY $(COMMERCIAL)

Installation

Configuration

  1. Rename /etc/sshd_config.sample to /etc/sshd_config
  2. Rename /etc/ssh_config.sample to /etc/ssh_config
  3. Run /usr/local/etc/ssh/generate-ssh-keys.sh

Edit config files

/etc/ssh_config

This is ssh client systemwide configuration file. This file provides defaults for users, and the values can be changed in per-user configuration files or on the command line.

/etc/sshd_config

This is ssh server systemwide configuration file. You should change the AllowHosts option to an appropriate mask e.g. *.fth.sbs.de. Please add the path to the PID file !!! The rc script to stop ssh in /etc/rc0.d/ will not work otherwise.

/etc/services

Add ssh Port# 22 # ssh 22/tcp to the services file.

Path to ssh

Add /usr/local/bin to the PATH var (it should already be in it ;-)). Normally there is no need to add the /usr/local/sbin/ to the user PATH because no user will ever want to run that. The startup scripts take care of adding the appropriate PATH when starting ssh.

Startup and shutdown of ssh

Create a startup script for sshd The startup scripts differ somewhat between the several operating systems. IRIX uses another method of starting daemons and software than SINIX (or Reliant-UNIX) and Solaris does. I tried to build the ssh startup scripts native for every OS. If there is some time left I'll publish them on this site.

Before you start ssh for the first time you need to compute a SSHD hostkey file. If you have a clean source code distribution then a make install takes care of the SSHD hostkeyfile. I you install my binary distribution then you have to run the script generate-ssh-keys.sh to generate a host key (or simply run a ssh-keygen. You may want to change the number of bits that the hostkey has. If you are compiling ssh the "make install" will take care of running ssh-keygen.

Last update by Hermann Heimhardt on 1998-12-11 13:16:50
Back to the main page