Compare commits

...
Author SHA1 Message Date
Damien Miller e2db1e1cc5 Renamed README 1999-10-30 14:50:37 +10:00
Damien Miller ccdfb8ca05 remove redundant file 1999-10-30 14:45:52 +10:00
Damien Miller 1e4772c32c Merged latest OpenBSD changes:
nchan.ms -\
channels.[ch] - remove broken x11 fix and document istate/ostate
ssh-agent.c - call setsid() regardless of argv[]
ssh.c - save a few lines when disabling rhosts-{rsa-}auth
1999-10-30 11:39:56 +10:00
Damien Miller 5ffa64478a Renamed README -> README.Ylonen
Renamed README.openssh -> README

Minor updated to new README
1999-10-30 11:30:35 +10:00
Damien Miller 2bbb9d0c99 Updated COPYING file with usage of RC4
Renamed sshd.init to sshd.init.redhat
1999-10-30 09:46:20 +10:00
Damien Miller 744da802bb - Integrated debian package support from Dan Brosemer <[email protected]> 1999-10-30 09:12:25 +10:00
Damien Miller d0562b3cdc Fix off by one error in PAM env patch
Tidy changelog
1999-10-29 13:09:40 +10:00
Damien Miller 65b3c13132 - Removed redundant subdirectories
- Integrated part of a patch from Dan Brosemer <[email protected]> for
   building on Debian.
1999-10-29 12:37:01 +10:00
Damien Miller 3c5cb3857b - Remove autoconf generated Makefile from CVS
- Stripped subdirectories from CVS server
 - Fixed makefile to suit
1999-10-29 12:06:53 +10:00
Damien Miller 07a826d854 - Make distclean now removed configure script
- Improved PAM logging
 - Added some debug() calls for PAM
1999-10-29 11:49:20 +10:00
Damien Miller 070f7a1fd0 Doc updates 1999-10-29 10:29:29 +10:00
Damien Miller 5eeedae9fe make install patch
Picked up lost bit of OpenBSD update to ssh.h

Fix compile warning in new pam_env stuff
1999-10-29 10:21:15 +10:00
Damien Miller 9438816a5c Integrated PAM environment patch from Nalin Dahyabhai <[email protected]>
Integrated make install patch from Niels Kristian Bech Jensen <[email protected]>
1999-10-29 09:57:31 +10:00
Damien Miller 792c5113f1 Update to OpenBSD ssh-19991029
Renamed init script and PAM config
1999-10-29 09:47:09 +10:00
Damien Miller a37010e466 Renamed open* -> * at request of Theo de Raadt <[email protected]> 1999-10-29 09:18:29 +10:00
Damien Miller f1d9a30b4f Path fix /etc -> /etc/ssh 1999-10-29 09:17:36 +10:00
Damien Miller 32aa144d70 Re-imported OpenBSD manpages 1999-10-29 09:15:49 +10:00
Damien Miller 34d0b614b3 Prepare for 1.2pre5 1999-10-28 17:51:40 +10:00
Damien Miller 29b5a590f2 Doc updates 1999-10-28 15:46:27 +10:00
Damien Miller 01ab4a25c8 Merged latest OpenBSD changes. 1999-10-28 15:23:30 +10:00
Damien Miller 29d685212f Rename PID file
Add symlinks back to ssh in RPM spec file
1999-10-28 14:34:49 +10:00
Damien Miller 92986dd9ba Re-added old changelog 1999-10-28 14:19:25 +10:00
Damien Miller eff18d6aaa Changelog update before test builds 1999-10-28 14:14:38 +10:00
Damien Miller e413cba972 Disabled code based on autoconf tests 1999-10-28 14:12:54 +10:00
Damien Miller 062307657e Big rename ssh* -> openssh* 1999-10-28 14:03:14 +10:00
Damien Miller 7f6ea0264d - Integrated patch from Dan Brosemer <[email protected]>
- Build fixes
   - Autoconf
   - Change binary names to open*

 - Fixed autoconf script to detect PAM on RH6.1
 - Added tests for libpwdb, and OpenBSD functions to autoconf (not used yet)
1999-10-28 13:25:17 +10:00
51 changed files with 2109 additions and 1559 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ restrictive); see below for details.
[ The make-ssh-known-hosts script is no longer included. ]
[ TSS has been removed. ]
[ MD5 is now external. ]
[ RC4 support has been removed. ]
[ RC4 support has been removed (RC4 is used internally for arc4random). ]
[ Blowfish is now external. ]
The 32-bit CRC implementation in crc32.c is due to Gary S. Brown.
+60 -578
View File
@@ -1,578 +1,60 @@
Fri Nov 17 16:19:20 1995 Tatu Ylonen <[email protected]>
* Released 1.2.12.
* channels.c: Commented out debugging messages about output draining.
* Added file OVERVIEW to give some idea about the structure of the
ssh software.
Thu Nov 16 16:40:17 1995 Tatu Ylonen <[email protected]>
* canohost.c (get_remote_hostname): Don't ever return NULL (causes
segmentation violation).
* sshconnect.c: Host ip address printed incorrectly with -v.
* Implemented SSH_TTY environment variable.
Wed Nov 15 01:47:40 1995 Tatu Ylonen <[email protected]>
* Implemented server and client option KeepAlive to specify
whether to set SO_KEEPALIVE. Both default to "yes"; to disable
keepalives, set the value to "no" in both the server and the
client configuration files. Updated manual pages.
* sshd.c: Fixed Solaris utmp problem: wrong pid stored in utmp
(patch from Petri Virkkula <[email protected]>).
* login.c (record_logout): Fixed removing user from utmp on BSD
(with HAVE_LIBUTIL_LOGIN).
* Added cleanup functions to be called from fatal(). Arranged for
utmp to be cleaned if sshd terminates by calling fatal (e.g.,
after dropping connection). Eliminated separate client-side
fatal() functions and moved fatal() to log-client.c. Made all
cleanups, including channel_stop_listening() and packet_close()
be called using this mechanism.
Thu Nov 9 09:58:05 1995 Tatu Ylonen <[email protected]>
* sshd.c: Permit immediate login with empty password only if
password authentication is allowed.
Wed Nov 8 00:43:55 1995 Tatu Ylonen <[email protected]>
* Eliminated unix-domain X11 forwarding. Inet-domain forwarding is
now the only supported form. Renamed server option
X11InetForwarding to X11Forwarding, and eliminated
X11UnixForwarding. Updated documentation. Updated RFC (marked
the SSH_CMSG_X11_REQUEST_FORWARDING message (code 26) as
obsolete, and removed all references to it). Increased protocol
version number to 1.3.
* scp.c (main): Added -B (BatchMode). Updated manual page.
* Cleaned up and updated all manual pages.
* clientloop.c: Added new escape sequences ~# (lists forwarded
connections), ~& (background ssh when waiting for forwarded
connections to terminate), ~? (list available escapes).
Polished the output of the connection listing. Updated
documentation.
* uidswap.c: If _POSIX_SAVED_IDS is defined, don't change the real
uid. Assume that _POSIX_SAVED_IDS also applies to seteuid.
This may solve problems with tcp_wrappers (libwrap) showing
connections as coming from root.
Tue Nov 7 20:28:57 1995 Tatu Ylonen <[email protected]>
* Added RandomSeed server configuration option. The argument
specifies the location of the random seed file. Updated
documentation.
* Locate perl5 in configure. Generate make-ssh-known-hosts (with
the correct path for perl5) in Makefile.in, and install it with
the other programs. Updated manual page.
* sshd.c (main): Added a call to umask to set the umask to a
reasonable value.
* compress.c (buffer_compress): Fixed to follow the zlib
documentation (which is slightly confusing).
* INSTALL: Added information about Linux libc.so.4 problem.
Mon Nov 6 15:42:36 1995 Tatu Ylonen <[email protected]>
* (Actually autoconf fix) Installed patch to AC_ARG_PROGRAM.
* sshd.c, sshd.8.in: Renamed $HOME/.environment ->
$HOME/.ssh/environment.
* configure.in: Disable shadow password checking on convex.
Convex has /etc/shadow, but sets pw_passwd automatically if
running as root.
* Eliminated HAVE_ETC_MASTER_PASSWD (NetBSD, FreeBSD); the
pw_passwd field is automatically filled if running as root.
Put explicit code in configure.in to prevent shadow password
checking on FreeBSD and NetBSD.
* serverloop.c (signchld_handler): Don't print error if wait
returns -1.
* Makefile.in (install): Fixed modes of data files.
* Makefile.in (install): Make links for slogin.1.
* make-ssh-known-hosts: Merged a patch from [email protected] to
fix the ping command.
Fri Nov 3 16:25:28 1995 Tatu Ylonen <[email protected]>
* ssh.1.in: Added more information about X11 forwarding.
Thu Nov 2 18:42:13 1995 Tatu Ylonen <[email protected]>
* Changes to use O_NONBLOCK_BROKEN consistently.
* pty.c (pty_make_controlling_tty): Use setpgid instead of
setsid() on Ultrix.
* includes.h: Removed redundant #undefs for Ultrix and Sony News;
these are already handled in configure.in.
Tue Oct 31 13:31:28 1995 Tatu Ylonen <[email protected]>
* configure.in: Define SSH_WTMP to /var/adm/wtmp is wtmp not found.
* configure.in: Disable vhangup on Ultrix. I am told this fixes
the server problems.
Sat Oct 28 14:22:05 1995 Tatu Ylonen <[email protected]>
* sshconnect.c: Fixed a bug in connecting to a multi-homed host.
Restructured the connecting code to never try to use the same
socket a second time after a failed connection.
* Makefile.in: Added explicit -m option to install, and umask 022
when creating directories and the host key.
Fri Oct 27 01:05:10 1995 Tatu Ylonen <[email protected]>
* Makefile.in: Added cleaning of $(ZLIBDIR) to clean and distclean.
* login.c (get_last_login_time): Fixed a typo (define -> defined).
Thu Oct 26 01:28:07 1995 Tatu Ylonen <[email protected]>
* configure.in: Moved testing for ANSI C compiler after the host
specific code (problems on HPUX).
* Minor fixes to /etc/default/login stuff from Bryan O'Sullivan.
* Fixed .SH NAME sections in manual pages.
* compress.c: Trying to fix a mysterious bug in the compression
glue.
* ssh-1.2.11.
* scp.c: disable agent forwarding when running ssh from scp.
* Added compression of plaintext packets using the gzip library
(zlib). Client configuration options Compression and
CompressionLevel (1-9 as in gzip). New ssh and scp option -C
(to enable compression). Updated RFC.
Wed Oct 25 05:11:55 1995 Tatu Ylonen <[email protected]>
* Implemented ProxyCommand stuff based on patches from Bryan
O'Sullivan <[email protected]>.
* Merged BSD login/logout/lastlog patches from Mark Treacy
<[email protected]>.
* sshd.c: Added chdir("/").
Tue Oct 24 00:29:01 1995 Tatu Ylonen <[email protected]>
* Merged RSA environment= patches from Felix Leitner
<[email protected]> with some changes.
* sshd.c: Made the packet code use two separate descriptors for
the connection (one for input, the other for output). This will
make future extensions easier (e.g., non-socket transports, etc.).
sshd -i now uses both stdin and stdout separately.
Mon Oct 23 21:29:28 1995 Tatu Ylonen <[email protected]>
* sshd.c: Merged execle -> execve patches from Mark Martinec
<[email protected]>. This may help with execle bugs on
Convex (environment not getting passed properly). This might
also solve similar problems on Sonys; please test!
* Removed all compatibility code for protocol version 1.0.
THIS MEANS THAT WE ARE NO LONGER COMPATIBLE WITH SSH VERSIONS
PRIOR TO 1.1.0.
* randoms.c (random_acquire_light_environmental_noise): If
/dev/random is available, read up to 32 bytes (256 bits) from
there in non-blocking mode, and mix the new random bytes into
the pool.
* Added client configuration option StrictHostKeyChecking
(disabled by default). If this is enabled, the client will not
automatically add new host keys to $HOME/.ssh/known_hosts;
instead the connection will be refused if the host key is not
known. Similarly, if the host key has changed, the connection
will be refused instead if just issuing a warning. This
provides additional security against man-in-the-middle/trojan
horse attacks (especially in scripts where there is no-one to
see the warnings), but may be quite inconvenient in everyday
interactive use unless /etc/ssh_known_hosts is very complete,
because new host keys must now be added manually.
* sshconnect.c (ssh_connect): Use the user's uid when creating the
socket and connecting it. I am hoping that this might help with
tcp_wrappers showing the remote user as root.
* ssh.c: Try inet-domain X11 forwarding regardless of whether we
can get local authorization information. If we don't, we just
come up with fake information; the forwarding code will anyway
generate its own fake information and validate that the client
knows that information. It will then substitute our fake
information for that, but that info should get ignored by the
server if it doesn't support it.
* Added option BatchMode to disable password/passphrase querying
in scripts.
* auth-rh-rsa.c: Changed to use uid-swapping when reading
.ssh/known_hosts.
* sshd.8.in (command): Improved documentation of file permissions
on the manual pages.
Thu Oct 19 21:05:51 1995 Tatu Ylonen <[email protected]>
* ssh-add.c (add_file): Fixed a bug causing ssh to sometimes refer
to freed memory (comment -> saved_comment).
* log-server.c: Added a prefix to debug/warning/error/fatal
messages describing message types. Syslog does not include that
information automatically.
Sun Oct 8 01:56:01 1995 Tatu Ylonen <[email protected]>
* Merged /etc/default/login and MAIL environment variable changes
from Bryan O'Sullivan <[email protected]>.
- mail spool file location
- process /etc/default/login
- add HAVE_ETC_DEFAULT_LOGIN
- new function child_get_env and read_etc_default_login (sshd.c)
* ssh-add.c (add_file): Fixed asking for passphrase.
* Makefile.in: Fixed installing configure-generated man pages when
compiling in a separate object directory.
* sshd.c (main): Moved RSA key generation until after allocating
the port number. (Actually, the code got duplicated because we
never listen when run from inetd.)
* ssh.c: Fixed a problem that caused scp to hang when called with
stdin closed.
Sat Oct 7 03:08:06 1995 Tatu Ylonen <[email protected]>
* Added server config option StrictModes. It specifies whether to
check ownership and modes of home directory and .rhosts files.
* ssh.c: If ssh is renamed/linked to a host name, connect to that
host.
* serverloop.c, clientloop.c: Ignore EAGAIN reported on read from
connection. Solaris has a kernel bug which causes select() to
sometimes wake up even though there is no data available.
* Display all open connections when printing the "Waiting for
forwarded connections to terminate" message.
* sshd.c, readconf.c: Added X11InetForwarding and
X11UnixForwarding server config options.
Thu Oct 5 17:41:16 1995 Tatu Ylonen <[email protected]>
* Some more SCO fixes.
Tue Oct 3 01:04:34 1995 Tatu Ylonen <[email protected]>
* Fixes and cleanups in README, INSTALL, COPYING.
Mon Oct 2 03:36:08 1995 Tatu Ylonen <[email protected]>
* ssh-add.c (add_file): Fixed a bug in ssh-add (xfree: NULL ...).
* Removed .BR from ".SH NAME" in man pages.
Sun Oct 1 04:16:07 1995 Tatu Ylonen <[email protected]>
* ssh-1.2.10.
* configure.in: When checking that the compiler works, check that
it understands ANSI C prototypes.
* Made uidswap error message a debug() to avoid confusing errors
on AIX (AIX geteuid is brain-damaged and fails even for root).
* Fixed an error in sshd.8 (FacistLogging -> FascistLogging).
* Fixed distribution in Makefile.in (missing manual page .in files).
Sat Sep 30 17:38:46 1995 Tatu Ylonen <[email protected]>
* auth-rhosts.c: Fixed serious security problem in
/etc/hosts.equiv authentication.
Fri Sep 29 00:41:02 1995 Tatu Ylonen <[email protected]>
* Include machine/endian.h on Paragon.
* ssh-add.c (add_file): Made ssh-add keep asking for the
passphrase until the user just types return or cancels.
Make the dialog display the comment of the key.
* Read use shosts.equiv in addition to /etc/hosts.equiv.
* sshd.8 is now sshd.8.in and is processed by configure to
substitute the proper paths for various files. Ditto for ssh.1.
Ditto for make-ssh-known-hosts.1.
* configure.in: Moved /etc/sshd_pid to PIDDIR/sshd.pid. PIDDIR
will be /var/run if it exists, and ETCDIR otherwise.
Thu Sep 28 21:52:42 1995 Tatu Ylonen <[email protected]>
* On Ultrix, check if sys/syslog.h needs to be included in
addition to syslog.h.
* make-ssh-known-hosts.pl: Merged Kivinen's fixes for HPUX.
* configure.in: Put -lwrap, -lsocks, etc. at the head of LIBS.
* Fixed case-insensitivity in auth-rhosts.c.
* Added missing socketpair.c to EXTRA_SRCS (needed on SCO), plus
other SCO fixes.
* Makefile.in: Fixed missing install_prefixes.
Wed Sep 27 03:57:00 1995 Tatu Ylonen <[email protected]>
* ssh-1.2.9.
* Added SOCKS support.
* Fixed default setting of IgnoreRhosts option.
* Pass the magic cookie to xauth in stdin instead of command line;
the command line is visible in ps.
* Added processing $HOME/.ssh/rc and /etc/sshrc.
* Added a section to sshd.8 on what happens at login time.
Tue Sep 26 01:27:40 1995 Tatu Ylonen <[email protected]>
* Don't define speed_t on SunOS 4.1.1; it conflicts with system
headers.
* Added support for .hushlogin.
* Added --with-etcdir.
* Read $HOME/.environment after /etc/environment.
Mon Sep 25 03:26:06 1995 Tatu Ylonen <[email protected]>
* Merged patches for SCO Unix (from Michael Henits).
Sun Sep 24 22:28:02 1995 Tatu Ylonen <[email protected]>
* Added ssh option ConnectionAttempts.
Sat Sep 23 12:30:15 1995 Tatu Ylonen <[email protected]>
* sshd.c: Don't print last login time and /etc/motd if a command
has been specified (with ssh -t host command).
* Added support for passing the screen number in X11 forwarding.
It is implemented as a compatible protocol extension, signalled
by SSH_PROTOFLAG_SCREEN_NUMBER by the child.
* clientloop.c: Fixed bugs in the order in which things were
processed. This may solve problems with some data not getting
sent to the server as soon as possible (probably solves the TCP
forwarding delayed close problem). Also, it looked like window
changes might not get transmitted as early as possible in some
cases.
* clientloop.c: Changed to detect window size change that
happened while ssh was suspended.
* ssh.c: Moved the do_session function (client main loop) to
clientloop.c. Divided it into smaller functions. General cleanup.
* ssh-1.2.8
Fri Sep 22 22:07:46 1995 Tatu Ylonen <[email protected]>
* sshconnect.c (ssh_login): Made ssh_login take the options
structure as argument, instead of the individual arguments.
* auth-rhosts.c (check_rhosts_file): Added support for netgroups.
* auth-rhosts.c (check_rhosts_file): Added support for negated
entries.
Thu Sep 21 00:07:56 1995 Tatu Ylonen <[email protected]>
* auth-rhosts.c: Restructured rhosts authentication code.
Hosts.equiv now has same format as .rhosts: user names are allowed.
* Added support for the Intel Paragon.
* sshd.c: Don't use X11 forwarding with spoofing if no xauth
program. Changed configure.in to not define XAUTH_PATH if
there is no xauth program.
* ssh-1.2.7
* sshd.c: Rewrote the code to build the environment. Now also reads
/etc/environment.
* sshd.c: Fixed problems in libwrap code. --with-libwrap now
takes optional library name/path.
* ssh-1.2.6
* Define USE_PIPES by default.
* Added support for Univel Unixware and MachTen.
* Added IgnoreRhosts server option.
* Added USE_STRLEN_FOR_AF_UNIX; it is needed at least on MachTen.
Wed Sep 20 02:41:02 1995 Tatu Ylonen <[email protected]>
* sshd.c (do_child): don't call packet_close when /etc/nologin,
because packet_close does shutdown, and the message does not get
sent.
* pty.c (pty_allocate): Push ttcompat streams module.
* randoms.c (random_acquire_light_environmental_noise): Don't use
the second argument to gettimeofday as it is not supported on
all systems.
* login.c (record_login): Added NULL second argument to gettimeofday.
Tue Sep 19 13:25:48 1995 Tatu Ylonen <[email protected]>
* fixed pclose wait() in sshd key regeneration (now only collects
easily available noise).
* configure.in: test for bsdi before bsd*.
* ssh.c: Don't print "Connection closed" if -q.
Wed Sep 13 04:19:52 1995 Tatu Ylonen <[email protected]>
* Released ssh-1.2.5.
* Hopefully fixed "Waiting for forwarded connections to terminate"
message.
* randoms.c, md5.c: Large modifications to make these work on Cray
(which has no 32 bit integer type).
* Fixed a problem with forwarded connection closes not being
reported immediately.
* ssh.c: fixed rhosts authentication (broken by uid-swapping).
* scp.c: Don't use -l if server user not specified (it made
setting User in the configuration file not work).
* configure.in: don't use -pipe on BSDI.
* randoms.c: Major modifications to make it work without 32 bit
integers (e.g. Cray).
* md5.c: Major modifications to make it work without 32 bit
integers (e.g. Cray).
* Eliminated HPSUX_BROKEN_PTYS. The code is now enabled by
default on all systems.
Mon Sep 11 00:53:12 1995 Tatu Ylonen <[email protected]>
* sshd.c: don't include sshd pathname in log messages.
* Added libwrap stuff (includes support for identd).
* Added OSF/1 C2 extended security stuff.
* Fixed interactions between getuid() and uid-swap stuff.
Sun Sep 10 00:29:27 1995 Tatu Ylonen <[email protected]>
* serverloop.c: Don't send stdout data to client until after a few
milliseconds if there is very little data. This is because some
systems give data from pty one character at a time, which would
multiply data size by about 16.
* serverloop.c: Moved server do_session to a separate file and
renamed it server_loop. Split it into several functions and
partially rewrote it. Fixed "cat /etc/termcap | ssh foo cat" hangup.
* Screwed up something while checking stuff in under cvs. No harm,
but bogus log entries...
Sat Sep 9 02:24:51 1995 Tatu Ylonen <[email protected]>
* minfd.c (_get_permanent_fd): Use SHELL environment variable.
* channels.c (x11_create_display_inet): Created
HPSUX_NONSTANDARD_X11_KLUDGE; it causes DISPLAY to contain the
IP address of the host instead of the name, because HPSUX uses
some magic shared memory communication for local connections.
* Changed SIGHUP processing in server; it should now work multiple
times.
* Added length limits in many debug/log/error/fatal calls just in
case.
* login.c (get_last_login_time): Fixed location of lastlog.
* Rewrote all uid-swapping code. New files uidswap.h, uidswap.c.
* Fixed several security problems involving chmod and chgrp (race
conditions). Added warnings about dubious modes for /tmp/.X11-unix.
Fri Sep 8 20:03:36 1995 Tatu Ylonen <[email protected]>
* Changed readconf.c to never display anything from the config
file. This should now be prevented otherwise, but let's play safe.
* log-server.c: Use %.500s in syslog() just to be sure (they
should already be shorter than 1024 though).
* sshd.c: Moved setuid in child a little earlier (just to be
conservative, there was no security problem that I could detect).
* README, INSTALL: Added info about mailing list and WWW page.
* sshd.c: Added code to use SIGCHLD and wait zombies immediately.
* Merged patch to set ut_addr in utmp.
* Created ChangeLog and added it to Makefile.in.
* Use read_passphrase instead of getpass().
* Added SSH_FALLBACK_CIPHER. Fixed a bug in default cipher
selection (IDEA used to be selected even if not supported by the
server).
* Use no encryption for key files if empty passphrase.
* Added section about --without-idea in INSTALL.
* Version 1.2.0 was released a couple of days ago.
19991030
- Integrated debian package support from Dan Brosemer <[email protected]>
- Merged latest updates for OpenBSD CVS:
- channels.[ch] - remove broken x11 fix and document istate/ostate
- ssh-agent.c - call setsid() regardless of argv[]
- ssh.c - save a few lines when disabling rhosts-{rsa-}auth
- Documentation cleanups
- Renamed README -> README.Ylonen
- Renamed README.openssh ->README
19991029
- Renamed openssh* back to ssh* at request of Theo de Raadt
- Incorporated latest changes from OpenBSD's CVS
- Integrated Makefile patch from Niels Kristian Bech Jensen <[email protected]>
- Integrated PAM env patch from Nalin Dahyabhai <[email protected]>
- Make distclean now removed configure script
- Improved PAM logging
- Added some debug() calls for PAM
- Removed redundant subdirectories
- Integrated part of a patch from Dan Brosemer <[email protected]> for
building on Debian.
- Fixed off-by-one error in PAM env patch
- Released 1.2pre6
19991028
- Further PAM enhancements.
- Much cleaner
- Now uses account and session modules for all logins.
- Integrated patch from Dan Brosemer <[email protected]>
- Build fixes
- Autoconf
- Change binary names to open*
- Fixed autoconf script to detect PAM on RH6.1
- Added tests for libpwdb, and OpenBSD functions to autoconf
- Released 1.2pre4
- Imported latest OpenBSD CVS code
- Updated README.openssh
- Released 1.2pre5
19991027
- Adapted PAM patch.
- Released 1.0pre2
- Excised my buggy replacements for strlcpy and mkdtemp
- Imported correct OpenBSD strlcpy and mkdtemp routines.
- Reduced arc4random_stir entropy read to 32 bytes (256 bits)
- Picked up correct version number from OpenBSD
- Added sshd.pam PAM configuration file
- Added sshd.init Redhat init script
- Added openssh.spec RPM spec file
- Released 1.2pre3
19991026
- Fixed include paths of OpenSSL functions
- Use OpenSSL MD5 routines
- Imported RC4 code from nanocrypt
- Wrote replacements for OpenBSD arc4random* functions
- Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1
+578
View File
@@ -0,0 +1,578 @@
Fri Nov 17 16:19:20 1995 Tatu Ylonen <[email protected]>
* Released 1.2.12.
* channels.c: Commented out debugging messages about output draining.
* Added file OVERVIEW to give some idea about the structure of the
ssh software.
Thu Nov 16 16:40:17 1995 Tatu Ylonen <[email protected]>
* canohost.c (get_remote_hostname): Don't ever return NULL (causes
segmentation violation).
* sshconnect.c: Host ip address printed incorrectly with -v.
* Implemented SSH_TTY environment variable.
Wed Nov 15 01:47:40 1995 Tatu Ylonen <[email protected]>
* Implemented server and client option KeepAlive to specify
whether to set SO_KEEPALIVE. Both default to "yes"; to disable
keepalives, set the value to "no" in both the server and the
client configuration files. Updated manual pages.
* sshd.c: Fixed Solaris utmp problem: wrong pid stored in utmp
(patch from Petri Virkkula <[email protected]>).
* login.c (record_logout): Fixed removing user from utmp on BSD
(with HAVE_LIBUTIL_LOGIN).
* Added cleanup functions to be called from fatal(). Arranged for
utmp to be cleaned if sshd terminates by calling fatal (e.g.,
after dropping connection). Eliminated separate client-side
fatal() functions and moved fatal() to log-client.c. Made all
cleanups, including channel_stop_listening() and packet_close()
be called using this mechanism.
Thu Nov 9 09:58:05 1995 Tatu Ylonen <[email protected]>
* sshd.c: Permit immediate login with empty password only if
password authentication is allowed.
Wed Nov 8 00:43:55 1995 Tatu Ylonen <[email protected]>
* Eliminated unix-domain X11 forwarding. Inet-domain forwarding is
now the only supported form. Renamed server option
X11InetForwarding to X11Forwarding, and eliminated
X11UnixForwarding. Updated documentation. Updated RFC (marked
the SSH_CMSG_X11_REQUEST_FORWARDING message (code 26) as
obsolete, and removed all references to it). Increased protocol
version number to 1.3.
* scp.c (main): Added -B (BatchMode). Updated manual page.
* Cleaned up and updated all manual pages.
* clientloop.c: Added new escape sequences ~# (lists forwarded
connections), ~& (background ssh when waiting for forwarded
connections to terminate), ~? (list available escapes).
Polished the output of the connection listing. Updated
documentation.
* uidswap.c: If _POSIX_SAVED_IDS is defined, don't change the real
uid. Assume that _POSIX_SAVED_IDS also applies to seteuid.
This may solve problems with tcp_wrappers (libwrap) showing
connections as coming from root.
Tue Nov 7 20:28:57 1995 Tatu Ylonen <[email protected]>
* Added RandomSeed server configuration option. The argument
specifies the location of the random seed file. Updated
documentation.
* Locate perl5 in configure. Generate make-ssh-known-hosts (with
the correct path for perl5) in Makefile.in, and install it with
the other programs. Updated manual page.
* sshd.c (main): Added a call to umask to set the umask to a
reasonable value.
* compress.c (buffer_compress): Fixed to follow the zlib
documentation (which is slightly confusing).
* INSTALL: Added information about Linux libc.so.4 problem.
Mon Nov 6 15:42:36 1995 Tatu Ylonen <[email protected]>
* (Actually autoconf fix) Installed patch to AC_ARG_PROGRAM.
* sshd.c, sshd.8.in: Renamed $HOME/.environment ->
$HOME/.ssh/environment.
* configure.in: Disable shadow password checking on convex.
Convex has /etc/shadow, but sets pw_passwd automatically if
running as root.
* Eliminated HAVE_ETC_MASTER_PASSWD (NetBSD, FreeBSD); the
pw_passwd field is automatically filled if running as root.
Put explicit code in configure.in to prevent shadow password
checking on FreeBSD and NetBSD.
* serverloop.c (signchld_handler): Don't print error if wait
returns -1.
* Makefile.in (install): Fixed modes of data files.
* Makefile.in (install): Make links for slogin.1.
* make-ssh-known-hosts: Merged a patch from [email protected] to
fix the ping command.
Fri Nov 3 16:25:28 1995 Tatu Ylonen <[email protected]>
* ssh.1.in: Added more information about X11 forwarding.
Thu Nov 2 18:42:13 1995 Tatu Ylonen <[email protected]>
* Changes to use O_NONBLOCK_BROKEN consistently.
* pty.c (pty_make_controlling_tty): Use setpgid instead of
setsid() on Ultrix.
* includes.h: Removed redundant #undefs for Ultrix and Sony News;
these are already handled in configure.in.
Tue Oct 31 13:31:28 1995 Tatu Ylonen <[email protected]>
* configure.in: Define SSH_WTMP to /var/adm/wtmp is wtmp not found.
* configure.in: Disable vhangup on Ultrix. I am told this fixes
the server problems.
Sat Oct 28 14:22:05 1995 Tatu Ylonen <[email protected]>
* sshconnect.c: Fixed a bug in connecting to a multi-homed host.
Restructured the connecting code to never try to use the same
socket a second time after a failed connection.
* Makefile.in: Added explicit -m option to install, and umask 022
when creating directories and the host key.
Fri Oct 27 01:05:10 1995 Tatu Ylonen <[email protected]>
* Makefile.in: Added cleaning of $(ZLIBDIR) to clean and distclean.
* login.c (get_last_login_time): Fixed a typo (define -> defined).
Thu Oct 26 01:28:07 1995 Tatu Ylonen <[email protected]>
* configure.in: Moved testing for ANSI C compiler after the host
specific code (problems on HPUX).
* Minor fixes to /etc/default/login stuff from Bryan O'Sullivan.
* Fixed .SH NAME sections in manual pages.
* compress.c: Trying to fix a mysterious bug in the compression
glue.
* ssh-1.2.11.
* scp.c: disable agent forwarding when running ssh from scp.
* Added compression of plaintext packets using the gzip library
(zlib). Client configuration options Compression and
CompressionLevel (1-9 as in gzip). New ssh and scp option -C
(to enable compression). Updated RFC.
Wed Oct 25 05:11:55 1995 Tatu Ylonen <[email protected]>
* Implemented ProxyCommand stuff based on patches from Bryan
O'Sullivan <[email protected]>.
* Merged BSD login/logout/lastlog patches from Mark Treacy
<[email protected]>.
* sshd.c: Added chdir("/").
Tue Oct 24 00:29:01 1995 Tatu Ylonen <[email protected]>
* Merged RSA environment= patches from Felix Leitner
<[email protected]> with some changes.
* sshd.c: Made the packet code use two separate descriptors for
the connection (one for input, the other for output). This will
make future extensions easier (e.g., non-socket transports, etc.).
sshd -i now uses both stdin and stdout separately.
Mon Oct 23 21:29:28 1995 Tatu Ylonen <[email protected]>
* sshd.c: Merged execle -> execve patches from Mark Martinec
<[email protected]>. This may help with execle bugs on
Convex (environment not getting passed properly). This might
also solve similar problems on Sonys; please test!
* Removed all compatibility code for protocol version 1.0.
THIS MEANS THAT WE ARE NO LONGER COMPATIBLE WITH SSH VERSIONS
PRIOR TO 1.1.0.
* randoms.c (random_acquire_light_environmental_noise): If
/dev/random is available, read up to 32 bytes (256 bits) from
there in non-blocking mode, and mix the new random bytes into
the pool.
* Added client configuration option StrictHostKeyChecking
(disabled by default). If this is enabled, the client will not
automatically add new host keys to $HOME/.ssh/known_hosts;
instead the connection will be refused if the host key is not
known. Similarly, if the host key has changed, the connection
will be refused instead if just issuing a warning. This
provides additional security against man-in-the-middle/trojan
horse attacks (especially in scripts where there is no-one to
see the warnings), but may be quite inconvenient in everyday
interactive use unless /etc/ssh_known_hosts is very complete,
because new host keys must now be added manually.
* sshconnect.c (ssh_connect): Use the user's uid when creating the
socket and connecting it. I am hoping that this might help with
tcp_wrappers showing the remote user as root.
* ssh.c: Try inet-domain X11 forwarding regardless of whether we
can get local authorization information. If we don't, we just
come up with fake information; the forwarding code will anyway
generate its own fake information and validate that the client
knows that information. It will then substitute our fake
information for that, but that info should get ignored by the
server if it doesn't support it.
* Added option BatchMode to disable password/passphrase querying
in scripts.
* auth-rh-rsa.c: Changed to use uid-swapping when reading
.ssh/known_hosts.
* sshd.8.in (command): Improved documentation of file permissions
on the manual pages.
Thu Oct 19 21:05:51 1995 Tatu Ylonen <[email protected]>
* ssh-add.c (add_file): Fixed a bug causing ssh to sometimes refer
to freed memory (comment -> saved_comment).
* log-server.c: Added a prefix to debug/warning/error/fatal
messages describing message types. Syslog does not include that
information automatically.
Sun Oct 8 01:56:01 1995 Tatu Ylonen <[email protected]>
* Merged /etc/default/login and MAIL environment variable changes
from Bryan O'Sullivan <[email protected]>.
- mail spool file location
- process /etc/default/login
- add HAVE_ETC_DEFAULT_LOGIN
- new function child_get_env and read_etc_default_login (sshd.c)
* ssh-add.c (add_file): Fixed asking for passphrase.
* Makefile.in: Fixed installing configure-generated man pages when
compiling in a separate object directory.
* sshd.c (main): Moved RSA key generation until after allocating
the port number. (Actually, the code got duplicated because we
never listen when run from inetd.)
* ssh.c: Fixed a problem that caused scp to hang when called with
stdin closed.
Sat Oct 7 03:08:06 1995 Tatu Ylonen <[email protected]>
* Added server config option StrictModes. It specifies whether to
check ownership and modes of home directory and .rhosts files.
* ssh.c: If ssh is renamed/linked to a host name, connect to that
host.
* serverloop.c, clientloop.c: Ignore EAGAIN reported on read from
connection. Solaris has a kernel bug which causes select() to
sometimes wake up even though there is no data available.
* Display all open connections when printing the "Waiting for
forwarded connections to terminate" message.
* sshd.c, readconf.c: Added X11InetForwarding and
X11UnixForwarding server config options.
Thu Oct 5 17:41:16 1995 Tatu Ylonen <[email protected]>
* Some more SCO fixes.
Tue Oct 3 01:04:34 1995 Tatu Ylonen <[email protected]>
* Fixes and cleanups in README, INSTALL, COPYING.
Mon Oct 2 03:36:08 1995 Tatu Ylonen <[email protected]>
* ssh-add.c (add_file): Fixed a bug in ssh-add (xfree: NULL ...).
* Removed .BR from ".SH NAME" in man pages.
Sun Oct 1 04:16:07 1995 Tatu Ylonen <[email protected]>
* ssh-1.2.10.
* configure.in: When checking that the compiler works, check that
it understands ANSI C prototypes.
* Made uidswap error message a debug() to avoid confusing errors
on AIX (AIX geteuid is brain-damaged and fails even for root).
* Fixed an error in sshd.8 (FacistLogging -> FascistLogging).
* Fixed distribution in Makefile.in (missing manual page .in files).
Sat Sep 30 17:38:46 1995 Tatu Ylonen <[email protected]>
* auth-rhosts.c: Fixed serious security problem in
/etc/hosts.equiv authentication.
Fri Sep 29 00:41:02 1995 Tatu Ylonen <[email protected]>
* Include machine/endian.h on Paragon.
* ssh-add.c (add_file): Made ssh-add keep asking for the
passphrase until the user just types return or cancels.
Make the dialog display the comment of the key.
* Read use shosts.equiv in addition to /etc/hosts.equiv.
* sshd.8 is now sshd.8.in and is processed by configure to
substitute the proper paths for various files. Ditto for ssh.1.
Ditto for make-ssh-known-hosts.1.
* configure.in: Moved /etc/sshd_pid to PIDDIR/sshd.pid. PIDDIR
will be /var/run if it exists, and ETCDIR otherwise.
Thu Sep 28 21:52:42 1995 Tatu Ylonen <[email protected]>
* On Ultrix, check if sys/syslog.h needs to be included in
addition to syslog.h.
* make-ssh-known-hosts.pl: Merged Kivinen's fixes for HPUX.
* configure.in: Put -lwrap, -lsocks, etc. at the head of LIBS.
* Fixed case-insensitivity in auth-rhosts.c.
* Added missing socketpair.c to EXTRA_SRCS (needed on SCO), plus
other SCO fixes.
* Makefile.in: Fixed missing install_prefixes.
Wed Sep 27 03:57:00 1995 Tatu Ylonen <[email protected]>
* ssh-1.2.9.
* Added SOCKS support.
* Fixed default setting of IgnoreRhosts option.
* Pass the magic cookie to xauth in stdin instead of command line;
the command line is visible in ps.
* Added processing $HOME/.ssh/rc and /etc/sshrc.
* Added a section to sshd.8 on what happens at login time.
Tue Sep 26 01:27:40 1995 Tatu Ylonen <[email protected]>
* Don't define speed_t on SunOS 4.1.1; it conflicts with system
headers.
* Added support for .hushlogin.
* Added --with-etcdir.
* Read $HOME/.environment after /etc/environment.
Mon Sep 25 03:26:06 1995 Tatu Ylonen <[email protected]>
* Merged patches for SCO Unix (from Michael Henits).
Sun Sep 24 22:28:02 1995 Tatu Ylonen <[email protected]>
* Added ssh option ConnectionAttempts.
Sat Sep 23 12:30:15 1995 Tatu Ylonen <[email protected]>
* sshd.c: Don't print last login time and /etc/motd if a command
has been specified (with ssh -t host command).
* Added support for passing the screen number in X11 forwarding.
It is implemented as a compatible protocol extension, signalled
by SSH_PROTOFLAG_SCREEN_NUMBER by the child.
* clientloop.c: Fixed bugs in the order in which things were
processed. This may solve problems with some data not getting
sent to the server as soon as possible (probably solves the TCP
forwarding delayed close problem). Also, it looked like window
changes might not get transmitted as early as possible in some
cases.
* clientloop.c: Changed to detect window size change that
happened while ssh was suspended.
* ssh.c: Moved the do_session function (client main loop) to
clientloop.c. Divided it into smaller functions. General cleanup.
* ssh-1.2.8
Fri Sep 22 22:07:46 1995 Tatu Ylonen <[email protected]>
* sshconnect.c (ssh_login): Made ssh_login take the options
structure as argument, instead of the individual arguments.
* auth-rhosts.c (check_rhosts_file): Added support for netgroups.
* auth-rhosts.c (check_rhosts_file): Added support for negated
entries.
Thu Sep 21 00:07:56 1995 Tatu Ylonen <[email protected]>
* auth-rhosts.c: Restructured rhosts authentication code.
Hosts.equiv now has same format as .rhosts: user names are allowed.
* Added support for the Intel Paragon.
* sshd.c: Don't use X11 forwarding with spoofing if no xauth
program. Changed configure.in to not define XAUTH_PATH if
there is no xauth program.
* ssh-1.2.7
* sshd.c: Rewrote the code to build the environment. Now also reads
/etc/environment.
* sshd.c: Fixed problems in libwrap code. --with-libwrap now
takes optional library name/path.
* ssh-1.2.6
* Define USE_PIPES by default.
* Added support for Univel Unixware and MachTen.
* Added IgnoreRhosts server option.
* Added USE_STRLEN_FOR_AF_UNIX; it is needed at least on MachTen.
Wed Sep 20 02:41:02 1995 Tatu Ylonen <[email protected]>
* sshd.c (do_child): don't call packet_close when /etc/nologin,
because packet_close does shutdown, and the message does not get
sent.
* pty.c (pty_allocate): Push ttcompat streams module.
* randoms.c (random_acquire_light_environmental_noise): Don't use
the second argument to gettimeofday as it is not supported on
all systems.
* login.c (record_login): Added NULL second argument to gettimeofday.
Tue Sep 19 13:25:48 1995 Tatu Ylonen <[email protected]>
* fixed pclose wait() in sshd key regeneration (now only collects
easily available noise).
* configure.in: test for bsdi before bsd*.
* ssh.c: Don't print "Connection closed" if -q.
Wed Sep 13 04:19:52 1995 Tatu Ylonen <[email protected]>
* Released ssh-1.2.5.
* Hopefully fixed "Waiting for forwarded connections to terminate"
message.
* randoms.c, md5.c: Large modifications to make these work on Cray
(which has no 32 bit integer type).
* Fixed a problem with forwarded connection closes not being
reported immediately.
* ssh.c: fixed rhosts authentication (broken by uid-swapping).
* scp.c: Don't use -l if server user not specified (it made
setting User in the configuration file not work).
* configure.in: don't use -pipe on BSDI.
* randoms.c: Major modifications to make it work without 32 bit
integers (e.g. Cray).
* md5.c: Major modifications to make it work without 32 bit
integers (e.g. Cray).
* Eliminated HPSUX_BROKEN_PTYS. The code is now enabled by
default on all systems.
Mon Sep 11 00:53:12 1995 Tatu Ylonen <[email protected]>
* sshd.c: don't include sshd pathname in log messages.
* Added libwrap stuff (includes support for identd).
* Added OSF/1 C2 extended security stuff.
* Fixed interactions between getuid() and uid-swap stuff.
Sun Sep 10 00:29:27 1995 Tatu Ylonen <[email protected]>
* serverloop.c: Don't send stdout data to client until after a few
milliseconds if there is very little data. This is because some
systems give data from pty one character at a time, which would
multiply data size by about 16.
* serverloop.c: Moved server do_session to a separate file and
renamed it server_loop. Split it into several functions and
partially rewrote it. Fixed "cat /etc/termcap | ssh foo cat" hangup.
* Screwed up something while checking stuff in under cvs. No harm,
but bogus log entries...
Sat Sep 9 02:24:51 1995 Tatu Ylonen <[email protected]>
* minfd.c (_get_permanent_fd): Use SHELL environment variable.
* channels.c (x11_create_display_inet): Created
HPSUX_NONSTANDARD_X11_KLUDGE; it causes DISPLAY to contain the
IP address of the host instead of the name, because HPSUX uses
some magic shared memory communication for local connections.
* Changed SIGHUP processing in server; it should now work multiple
times.
* Added length limits in many debug/log/error/fatal calls just in
case.
* login.c (get_last_login_time): Fixed location of lastlog.
* Rewrote all uid-swapping code. New files uidswap.h, uidswap.c.
* Fixed several security problems involving chmod and chgrp (race
conditions). Added warnings about dubious modes for /tmp/.X11-unix.
Fri Sep 8 20:03:36 1995 Tatu Ylonen <[email protected]>
* Changed readconf.c to never display anything from the config
file. This should now be prevented otherwise, but let's play safe.
* log-server.c: Use %.500s in syslog() just to be sure (they
should already be shorter than 1024 though).
* sshd.c: Moved setuid in child a little earlier (just to be
conservative, there was no security problem that I could detect).
* README, INSTALL: Added info about mailing list and WWW page.
* sshd.c: Added code to use SIGCHLD and wait zombies immediately.
* Merged patch to set ut_addr in utmp.
* Created ChangeLog and added it to Makefile.in.
* Use read_passphrase instead of getpass().
* Added SSH_FALLBACK_CIPHER. Fixed a bug in default cipher
selection (IDEA used to be selected even if not supported by the
server).
* Use no encryption for key files if empty passphrase.
* Added section about --without-idea in INSTALL.
* Version 1.2.0 was released a couple of days ago.
-20
View File
@@ -1,20 +0,0 @@
19991027
- Adapted PAM patch.
- Released 1.0pre2
- Excised my buggy replacements for strlcpy and mkdtemp
- Imported correct OpenBSD strlcpy and mkdtemp routines.
- Reduced arc4random_stir entropy read to 32 bytes (256 bits)
- Picked up correct version number from OpenBSD
- Added sshd.pam PAM configuration file
- Added sshd.init Redhat init script
- Added openssh.spec RPM spec file
- Released 1.2pre3
19991026
- Fixed include paths of OpenSSL functions
- Use OpenSSL MD5 routines
- Imported RC4 code from nanocrypt
- Wrote replacements for OpenBSD arc4random* functions
- Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1
-13
View File
@@ -1,13 +0,0 @@
# $OpenBSD: Makefile,v 1.5 1999/10/25 20:27:26 markus Exp $
.include <bsd.own.mk>
SUBDIR= lib ssh sshd ssh-add ssh-keygen ssh-agent scp
distribution:
install -C -o root -g wheel -m 0644 ${.CURDIR}/ssh_config \
${DESTDIR}/etc/ssh_config
install -C -o root -g wheel -m 0644 ${.CURDIR}/sshd_config \
${DESTDIR}/etc/sshd_config
.include <bsd.subdir.mk>
-50
View File
@@ -1,50 +0,0 @@
OPT_FLAGS=-g
CFLAGS=$(OPT_FLAGS) -Wall -DETCDIR=\"/etc/ssh\" -DHAVE_PAM -DHAVE_PWDB
TARGETS=bin/libssh.a bin/ssh bin/sshd bin/ssh-add bin/ssh-keygen bin/ssh-agent bin/scp
LFLAGS=-L./bin
LIBS=-lssh -lcrypto -lz -lutil -lpwdb -lpam -ldl
AR=ar
RANLIB=ranlib
OBJS= authfd.o authfile.o auth-passwd.o auth-rhosts.o auth-rh-rsa.o \
auth-rsa.o bufaux.o buffer.o canohost.o channels.o cipher.o \
clientloop.o compress.o crc32.o deattack.o hostfile.o \
log-client.o login.o log-server.o match.o mpaux.o packet.o pty.o \
readconf.o readpass.o rsa.o servconf.o serverloop.o \
sshconnect.o tildexpand.o ttymodes.o uidswap.o xmalloc.o \
helper.o mktemp.o strlcpy.o rc4.o
all: $(OBJS) $(TARGETS)
bin/libssh.a: authfd.o authfile.o bufaux.o buffer.o canohost.o channels.o cipher.o compat.o compress.o crc32.o deattack.o hostfile.o match.o mpaux.o nchan.o packet.o readpass.o rsa.o tildexpand.o ttymodes.o uidswap.o xmalloc.o helper.o rc4.o mktemp.o strlcpy.o
[ -d bin ] || mkdir bin
$(AR) rv $@ $^
$(RANLIB) $@
bin/ssh: ssh.o sshconnect.o log-client.o readconf.o clientloop.o
[ -d bin ] || mkdir bin
$(CC) -o $@ $^ $(LFLAGS) $(LIBS)
bin/sshd: sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o pty.o log-server.o login.o servconf.o serverloop.o
[ -d bin ] || mkdir bin
$(CC) -o $@ $^ $(LFLAGS) $(LIBS)
bin/scp: scp.o
[ -d bin ] || mkdir bin
$(CC) -o $@ $^ $(LFLAGS) $(LIBS)
bin/ssh-add: ssh-add.o log-client.o
[ -d bin ] || mkdir bin
$(CC) -o $@ $^ $(LFLAGS) $(LIBS)
bin/ssh-agent: ssh-agent.o log-client.o
[ -d bin ] || mkdir bin
$(CC) -o $@ $^ $(LFLAGS) $(LIBS)
bin/ssh-keygen: ssh-keygen.o log-client.o
[ -d bin ] || mkdir bin
$(CC) -o $@ $^ $(LFLAGS) $(LIBS)
clean:
rm -f *.o core bin/*
+74
View File
@@ -0,0 +1,74 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
sbindir=@sbindir@
libdir=@libdir@
mandir=@mandir@
CC=@CC@
OPT_FLAGS=-g
CFLAGS=$(OPT_FLAGS) -Wall -DETCDIR=\"@sysconfdir@\" @DEFS@
TARGETS=libssh.a ssh sshd ssh-add ssh-keygen ssh-agent scp
LFLAGS=-L.
LIBS=-lssh @LIBS@
AR=@AR@
RANLIB=@RANLIB@
OBJS= authfd.o authfile.o auth-passwd.o auth-rhosts.o auth-rh-rsa.o \
auth-rsa.o bufaux.o buffer.o canohost.o channels.o cipher.o \
clientloop.o compress.o crc32.o deattack.o helper.o hostfile.o \
log-client.o login.o log-server.o match.o mpaux.o packet.o pty.o \
readconf.o readpass.o rsa.o servconf.o serverloop.o \
sshconnect.o tildexpand.o ttymodes.o uidswap.o xmalloc.o \
helper.o mktemp.o strlcpy.o rc4.o
all: $(OBJS) $(TARGETS)
libssh.a: authfd.o authfile.o bufaux.o buffer.o canohost.o channels.o cipher.o compat.o compress.o crc32.o deattack.o hostfile.o match.o mpaux.o nchan.o packet.o readpass.o rsa.o tildexpand.o ttymodes.o uidswap.o xmalloc.o helper.o rc4.o mktemp.o strlcpy.o
$(AR) rv $@ $^
$(RANLIB) $@
ssh: ssh.o sshconnect.o log-client.o readconf.o clientloop.o
$(CC) -o $@ $^ $(LFLAGS) $(LIBS)
sshd: sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o pty.o log-server.o login.o servconf.o serverloop.o
$(CC) -o $@ $^ $(LFLAGS) $(LIBS)
scp: scp.o
$(CC) -o $@ $^ $(LFLAGS) $(LIBS)
ssh-add: ssh-add.o log-client.o
$(CC) -o $@ $^ $(LFLAGS) $(LIBS)
ssh-agent: ssh-agent.o log-client.o
$(CC) -o $@ $^ $(LFLAGS) $(LIBS)
ssh-keygen: ssh-keygen.o log-client.o
$(CC) -o $@ $^ $(LFLAGS) $(LIBS)
clean:
rm -f *.o core $(TARGETS) config.status config.cache config.log
install:
install -d $(bindir)
install -d $(sbindir)
install -d $(mandir)
install -d $(mandir)/man1
install -d $(mandir)/man8
install -s -c ssh $(bindir)/ssh
install -s -c scp $(bindir)/scp
install -s -c ssh-add $(bindir)/ssh-add
install -s -c ssh-agent $(bindir)/ssh-agent
install -s -c ssh-keygen $(bindir)/ssh-keygen
install -s -c sshd $(sbindir)/sshd
install -m644 -c ssh.1 $(mandir)/man1/ssh.1
install -m644 -c scp.1 $(mandir)/man1/scp.1
install -m644 -c ssh-add.1 $(mandir)/man1/ssh-add.1
install -m644 -c ssh-agent.1 $(mandir)/man1/ssh-agent.1
install -m644 -c ssh-keygen.1 $(mandir)/man1/ssh-keygen.1
install -m644 -c sshd.8 $(mandir)/man8/sshd.8
distclean: clean
rm -f Makefile config.h core configure *~
mrproper: distclean
-11
View File
@@ -1,11 +0,0 @@
CFLAGS+= -I${.CURDIR}/..
.include <bsd.obj.mk>
.if exists(${.CURDIR}/../lib/${__objdir})
LDADD+= -L${.CURDIR}/../lib/${__objdir} -lssh
DPADD+= ${.CURDIR}/../lib/${__objdir}/libssh.a
.else
LDADD+= -L${.CURDIR}/../lib -lssh
DPADD+= ${.CURDIR}/../lib/libssh.a
.endif
+39 -549
View File
@@ -1,563 +1,53 @@
Ssh (Secure Shell) is a program to log into another computer over a
network, to execute commands in a remote machine, and to move files
from one machine to another. It provides strong authentication and
secure communications over insecure channels. It is inteded as a
replacement for rlogin, rsh, rcp, and rdist.
This is a Linux port of OpenBSD's excellent OpenSSH.
See the file INSTALL for installation instructions. See COPYING for
license terms and other legal issues. See RFC for a description of
the protocol. There is a WWW page for ssh; see http://www.cs.hut.fi/ssh.
OpenSSH is based on the last free version of Tatu Ylonen's SSH with
all patent-encumbered algorithms removed, all known security bugs
fixed, new features reintroduced and many other clean-ups.
This file has been updated to match ssh-1.2.12.
This Linux port basically consists of a few fixes to deal with the way
that OpenSSL is usually installed on Linux systems, a few replacements
for OpenBSD library functions and the introduction of PAM support. This
version tracks changes made to the OpenBSD CVS version.
The PAM support is now more functional than the popular packages of
commercial ssh-1.2.x. It checks "account" and "session" modules for
all logins, not just when using password authentication. This code is
very new and needs further testing. I have also added basic libpwdb
support (detected by autoconf).
FEATURES
All new code is released under a XFree style license, which is very
liberal. This code is released with no warranties of any kind,
neither I nor my employer (Internet Business Solutions) will take any
responsibility for any loss, damage or liability arising from the use
or abuse of this software. The code in strlcpy.c and mktemp.c is from
the OpenBSD project and has its own license (see source file for
details).
o Strong authentication. Closes several security holes (e.g., IP,
routing, and DNS spoofing). New authentication methods: .rhosts
together with RSA based host authentication, and pure RSA
authentication.
OpenSSH depends on Zlib, OpenSSL and PAM and optionally libpwdb. It now
uses autoconf to build thanks to Dan Brosemer <[email protected]>
o Improved privacy. All communications are automatically and
transparently encrypted. RSA is used for key exchange, and a
conventional cipher (normally IDEA, DES, or triple-DES) for
encrypting the session. Encryption is started before
authentication, and no passwords or other information is
transmitted in the clear. Encryption is also used to protect
against spoofed packets.
Damien Miller <[email protected]>
Internet Business Solutions
o Secure X11 sessions. The program automatically sets DISPLAY on
the server machine, and forwards any X11 connections over the
secure channel. Fake Xauthority information is automatically
generated and forwarded to the remote machine; the local client
automatically examines incoming X11 connections and replaces the
fake authorization data with the real data (never telling the
remote machine the real information).
o Arbitrary TCP/IP ports can be redirected through the encrypted channel
in both directions (e.g., for e-cash transactions).
Credits -
o No retraining needed for normal users; everything happens
automatically, and old .rhosts files will work with strong
authentication if administration installs host key files.
The OpenBSD team
'jonchen' - the original author of PAM support of SSH
Dan Brosemer <[email protected]> - Autoconf and build fixes & Debian scripts
Niels Kristian Bech Jensen <[email protected]> - Makefile patch
Nalin Dahyabhai <[email protected]> - PAM environment patch
o Never trusts the network. Minimal trust on the remote side of
the connection. Minimal trust on domain name servers. Pure RSA
authentication never trusts anything but the private key.
Miscellania -
o Client RSA-authenticates the server machine in the beginning of
every connection to prevent trojan horses (by routing or DNS
spoofing) and man-in-the-middle attacks, and the server
RSA-authenticates the client machine before accepting .rhosts or
/etc/hosts.equiv authentication (to prevent DNS, routing, or
IP-spoofing).
This version of SSH is based upon code retrieved from the OpenBSD CVS
repository on 1999-10-30 patched by Damien Miller <[email protected]>,
which in turn was based on the last free version of SSH released by
Tatu Ylonen.
o Host authentication key distribution can be centrally by the
administration, automatically when the first connection is made
to a machine (the key obtained on the first connection will be
recorded and used for authentication in the future), or manually
by each user for his/her own use. The central and per-user host
key repositories are both used and complement each other. Host
keys can be generated centrally or automatically when the software
is installed. Host authentication keys are typically 1024 bits.
Code in helper.[ch] is Copyright 1999 Internet Business Solutions and
is released under a X11-style license (see source file for details).
o Any user can create any number of user authentication RSA keys for
his/her own use. Each user has a file which lists the RSA public
keys for which proof of possession of the corresponding private
key is accepted as authentication. User authentication keys are
typically 1024 bits.
(A)RC4 code in rc4.[ch] is Copyright 1999 Damien Miller. It too is
under a X11-style license (see source file for details).
o The server program has its own server RSA key which is
automatically regenerated every hour. This key is never saved in
any file. Exchanged session keys are encrypted using both the
server key and the server host key. The purpose of the separate
server key is to make it impossible to decipher a captured session by
breaking into the server machine at a later time; one hour from
the connection even the server machine cannot decipher the session
key. The key regeneration interval is configurable. The server
key is normally 768 bits.
o An authentication agent, running in the user's laptop or local
workstation, can be used to hold the user's RSA authentication
keys. Ssh automatically forwards the connection to the
authentication agent over any connections, and there is no need to
store the RSA authentication keys on any machine in the network
(except the user's own local machine). The authentication
protocols never reveal the keys; they can only be used to verify
that the user's agent has a certain key. Eventually the agent
could rely on a smart card to perform all authentication
computations.
o The software can be installed and used (with restricted
functionality) even without root privileges.
o The client is customizable in system-wide and per-user
configuration files. Most aspects of the client's operation can
be configured. Different options can be specified on a per-host basis.
o Automatically executes conventional rsh (after displaying a
warning) if the server machine is not running sshd.
o Optional compression of all data with gzip (including forwarded X11
and TCP/IP port data), which may result in significant speedups on
slow connections.
o Complete replacement for rlogin, rsh, and rcp.
WHY TO USE SECURE SHELL
Currently, almost all communications in computer networks are done
without encryption. As a consequence, anyone who has access to any
machine connected to the network can listen in on any communication.
This is being done by hackers, curious administrators, employers,
criminals, industrial spies, and governments. Some networks leak off
enough electromagnetic radiation that data may be captured even from a
distance.
When you log in, your password goes in the network in plain
text. Thus, any listener can then use your account to do any evil he
likes. Many incidents have been encountered worldwide where crackers
have started programs on workstations without the owners knowledge
just to listen to the network and collect passwords. Programs for
doing this are available on the Internet, or can be built by a
competent programmer in a few hours.
Any information that you type or is printed on your screen can be
monitored, recorded, and analyzed. For example, an intruder who has
penetrated a host connected to a major network can start a program
that listens to all data flowing in the network, and whenever it
encounters a 16-digit string, it checks if it is a valid credit card
number (using the check digit), and saves the number plus any
surrounding text (to catch expiration date and holder) in a file.
When the intruder has collected a few thousand credit card numbers, he
makes smallish mail-order purchases from a few thousand stores around
the world, and disappears when the goods arrive but before anyone
suspects anything.
Businesses have trade secrets, patent applications in preparation,
pricing information, subcontractor information, client data, personnel
data, financial information, etc. Currently, anyone with access to
the network (any machine on the network) can listen to anything that
goes in the network, without any regard to normal access restrictions.
Many companies are not aware that information can so easily be
recovered from the network. They trust that their data is safe
since nobody is supposed to know that there is sensitive information
in the network, or because so much other data is transferred in the
network. This is not a safe policy.
Individual persons also have confidential information, such as
diaries, love letters, health care documents, information about their
personal interests and habits, professional data, job applications,
tax reports, political documents, unpublished manuscripts, etc.
One should also be aware that economical intelligence and industrial
espionage has recently become a major priority of the intelligence
agencies of major governments. President Clinton recently assigned
economical espionage as the primary task of the CIA, and the French
have repeatedly been publicly boasting about their achievements on
this field.
There is also another frightening aspect about the poor security of
communications. Computer storage and analysis capability has
increased so much that it is feasible for governments, major
companies, and criminal organizations to automatically analyze,
identify, classify, and file information about millions of people over
the years. Because most of the work can be automated, the cost of
collecting this information is getting very low.
Government agencies may be able to monitor major communication
systems, telephones, fax, computer networks, etc., and passively
collect huge amounts of information about all people with any
significant position in the society. Most of this information is not
sensitive, and many people would say there is no harm in someone
getting that information. However, the information starts to get
sensitive when someone has enough of it. You may not mind someone
knowing what you bought from the shop one random day, but you might
not like someone knowing every small thing you have bought in the last
ten years.
If the government some day starts to move into a more totalitarian
direction (one should remember that Nazi Germany was created by
democratic elections), there is considerable danger of an ultimate
totalitarian state. With enough information (the automatically
collected records of an individual can be manually analyzed when the
person becomes interesting), one can form a very detailed picture of
the individual's interests, opinions, beliefs, habits, friends,
lovers, weaknesses, etc. This information can be used to 1) locate
any persons who might oppose the new system 2) use deception to
disturb any organizations which might rise against the government 3)
eliminate difficult individuals without anyone understanding what
happened. Additionally, if the government can monitor communications
too effectively, it becomes too easy to locate and eliminate any
persons distributing information contrary to the official truth.
Fighting crime and terrorism are often used as grounds for domestic
surveillance and restricting encryption. These are good goals, but
there is considerable danger that the surveillance data starts to get
used for questionable purposes. I find that it is better to tolerate
a small amount of crime in the society than to let the society become
fully controlled. I am in favor of a fairly strong state, but the
state must never get so strong that people become unable to spread
contra-offical information and unable to overturn the government if it
is bad. The danger is that when you notice that the government is
too powerful, it is too late. Also, the real power may not be where
the official government is.
For these reasons (privacy, protecting trade secrets, and making it
more difficult to create a totalitarian state), I think that strong
cryptography should be integrated to the tools we use every day.
Using it causes no harm (except for those who wish to monitor
everything), but not using it can cause huge problems. If the society
changes in undesirable ways, then it will be to late to start
encrypting.
Encryption has had a "military" or "classified" flavor to it. There
are no longer any grounds for this. The military can and will use its
own encryption; that is no excuse to prevent the civilians from
protecting their privacy and secrets. Information on strong
encryption is available in every major bookstore, scientific library,
and patent office around the world, and strong encryption software is
available in every country on the Internet.
Some people would like to make it illegal to use encryption, or to
force people to use encryption that governments can break. This
approach offers no protection if the government turns bad. Also, the
"bad guys" will be using true strong encryption anyway. Good
encryption techniques are too widely known to make them disappear.
Thus, any "key escrow encryption" or other restrictions will only help
monitor ordinary people and petty criminals. It does not help against
powerful criminals, terrorists, or espionage, because they will know
how to use strong encryption anyway. (One source for internationally
available encryption software is http://www.cs.hut.fi/crypto.)
OVERVIEW OF SECURE SHELL
The software consists of a number of programs.
sshd Server program run on the server machine. This
listens for connections from client machines, and
whenever it receives a connection, it performs
authentication and starts serving the client.
ssh This is the client program used to log into another
machine or to execute commands on the other machine.
"slogin" is another name for this program.
scp Securely copies files from one machine to another.
ssh-keygen Used to create RSA keys (host keys and user
authentication keys).
ssh-agent Authentication agent. This can be used to hold RSA
keys for authentication.
ssh-add Used to register new keys with the agent.
make-ssh-known-hosts
Used to create the /etc/ssh_known_hosts file.
Ssh is the program users normally use. It is started as
ssh host
or
ssh host command
The first form opens a new shell on the remote machine (after
authentication). The latter form executes the command on the remote
machine.
When started, the ssh connects sshd on the server machine, verifies
that the server machine really is the machine it wanted to connect,
exchanges encryption keys (in a manner which prevents an outside
listener from getting the keys), performs authentication using .rhosts
and /etc/hosts.equiv, RSA authentication, or conventional password
based authentication. The server then (normally) allocates a
pseudo-terminal and starts an interactive shell or user program.
The TERM environment variable (describing the type of the user's
terminal) is passed from the client side to the remote side. Also,
terminal modes will be copied from the client side to the remote side
to preserve user preferences (e.g., the erase character).
If the DISPLAY variable is set on the client side, the server will
create a dummy X server and set DISPLAY accordingly. Any connections
to the dummy X server will be forwarded through the secure channel,
and will be made to the real X server from the client side. An
arbitrary number of X programs can be started during the session, and
starting them does not require anything special from the user. (Note
that the user must not manually set DISPLAY, because then it would
connect directly to the real display instead of going through the
encrypted channel). This behavior can be disabled in the
configuration file or by giving the -x option to the client.
Arbitrary IP ports can be forwarded over the secure channel. The
program then creates a port on one side, and whenever a connection is
opened to this port, it will be passed over the secure channel, and a
connection will be made from the other side to a specified host:port
pair. Arbitrary IP forwarding must always be explicitly requested,
and cannot be used to forward privileged ports (unless the user is
root). It is possible to specify automatic forwards in a per-user
configuration file, for example to make electronic cash systems work
securely.
If there is an authentication agent on the client side, connection to
it will be automatically forwarded to the server side.
For more infomation, see the manual pages ssh(1), sshd(8), scp(1),
ssh-keygen(1), ssh-agent(1), ssh-add(1), and make-ssh-known-hosts(1)
included in this distribution.
X11 CONNECTION FORWARDING
X11 forwarding serves two purposes: it is a convenience to the user
because there is no need to set the DISPLAY variable, and it provides
encrypted X11 connections. I cannot think of any other easy way to
make X11 connections encrypted; modifying the X server, clients or
libraries would require special work for each machine, vendor and
application. Widely used IP-level encryption does not seem likely for
several years. Thus what we have left is faking an X server on the
same machine where the clients are run, and forwarding the connections
to a real X server over the secure channel.
X11 forwarding works as follows. The client extracts Xauthority
information for the server. It then creates random authorization
data, and sends the random data to the server. The server allocates
an X11 display number, and stores the (fake) Xauthority data for this
display. Whenever an X11 connection is opened, the server forwards
the connection over the secure channel to the client, and the client
parses the first packet of the X11 protocol, substitutes real
authentication data for the fake data (if the fake data matched), and
forwards the connection to the real X server.
If the display does not have Xauthority data, the server will create a
unix domain socket in /tmp/.X11-unix, and use the unix domain socket
as the display. No authentication information is forwarded in this
case. X11 connections are again forwarded over the secure channel.
To the X server the connections appear to come from the client
machine, and the server must have connections allowed from the local
machine. Using authentication data is always recommended because not
using it makes the display insecure. If XDM is used, it automatically
generates the authentication data.
One should be careful not to use "xin" or "xstart" or other similar
scripts that explicitly set DISPLAY to start X sessions in a remote
machine, because the connection will then not go over the secure
channel. The recommended way to start a shell in a remote machine is
xterm -e ssh host &
and the recommended way to execute an X11 application in a remote
machine is
ssh -n host emacs &
If you need to type a password/passphrase for the remote machine,
ssh -f host emacs
may be useful.
RSA AUTHENTICATION
RSA authentication is based on public key cryptograpy. The idea is
that there are two encryption keys, one for encryption and another for
decryption. It is not possible (on human timescale) to derive the
decryption key from the encryption key. The encryption key is called
the public key, because it can be given to anyone and it is not
secret. The decryption key, on the other hand, is secret, and is
called the private key.
RSA authentication is based on the impossibility of deriving the
private key from the public key. The public key is stored on the
server machine in the user's $HOME/.ssh/authorized_keys file. The
private key is only kept on the user's local machine, laptop, or other
secure storage. Then the user tries to log in, the client tells the
server the public key that the user wishes to use for authentication.
The server then checks if this public key is admissible. If so, it
generates a 256 bit random number, encrypts it with the public key,
and sends the value to the client. The client then decrypts the
number with its private key, computes a 128 bit MD5 checksum from the
resulting data, and sends the checksum back to the server. (Only a
checksum is sent to prevent chosen-plaintext attacks against RSA.)
The server checks computes a checksum from the correct data,
and compares the checksums. Authentication is accepted if the
checksums match. (Theoretically this indicates that the client
only probably knows the correct key, but for all practical purposes
there is no doubt.)
The RSA private key can be protected with a passphrase. The
passphrase can be any string; it is hashed with MD5 to produce an
encryption key for IDEA, which is used to encrypt the private part of
the key file. With passphrase, authorization requires access to the key
file and the passphrase. Without passphrase, authorization only
depends on possession of the key file.
RSA authentication is the most secure form of authentication supported
by this software. It does not rely on the network, routers, domain
name servers, or the client machine. The only thing that matters is
access to the private key.
All this, of course, depends on the security of the RSA algorithm
itself. RSA has been widely known since about 1978, and no effective
methods for breaking it are known if it is used properly. Care has
been taken to avoid the well-known pitfalls. Breaking RSA is widely
believed to be equivalent to factoring, which is a very hard
mathematical problem that has received considerable public research.
So far, no effective methods are known for numbers bigger than about
512 bits. However, as computer speeds and factoring methods are
increasing, 512 bits can no longer be considered secure. The
factoring work is exponential, and 768 or 1024 bits are widely
considered to be secure in the near future.
RHOSTS AUTHENTICATION
Conventional .rhosts and hosts.equiv based authentication mechanisms
are fundamentally insecure due to IP, DNS (domain name server) and
routing spoofing attacks. Additionally this authentication method
relies on the integrity of the client machine. These weaknesses is
tolerable, and been known and exploited for a long time.
Ssh provides an improved version of these types of authentication,
because they are very convenient for the user (and allow easy
transition from rsh and rlogin). It permits these types of
authentication, but additionally requires that the client host be
authenticated using RSA.
The server has a list of host keys stored in /etc/ssh_known_host, and
additionally each user has host keys in $HOME/.ssh/known_hosts. Ssh
uses the name servers to obtain the canonical name of the client host,
looks for its public key in its known host files, and requires the
client to prove that it knows the private host key. This prevents IP
and routing spoofing attacks (as long as the client machine private
host key has not been compromized), but is still vulnerable to DNS
attacks (to a limited extent), and relies on the integrity of the
client machine as to who is requesting to log in. This prevents
outsiders from attacking, but does not protect against very powerful
attackers. If maximal security is desired, only RSA authentication
should be used.
It is possible to enable conventional .rhosts and /etc/hosts.equiv
authentication (without host authentication) at compile time by giving
the option --with-rhosts to configure. However, this is not
recommended, and is not done by default.
These weaknesses are present in rsh and rlogin. No improvement in
security will be obtained unless rlogin and rsh are completely
disabled (commented out in /etc/inetd.conf). This is highly
recommended.
WEAKEST LINKS IN SECURITY
One should understand that while this software may provide
cryptographically secure communications, it may be easy to
monitor the communications at their endpoints.
Basically, anyone with root access on the local machine on which you
are running the software may be able to do anything. Anyone with root
access on the server machine may be able to monitor your
communications, and a very talented root user might even be able to
send his/her own requests to your authentication agent.
One should also be aware that computers send out electromagnetic
radition that can sometimes be picked up hundreds of meters away.
Your keyboard is particularly easy to listen to. The image on your
monitor might also be seen on another monitor in a van parked behind
your house.
Beware that unwanted visitors might come to your home or office and
use your machine while you are away. They might also make
modifications or install bugs in your hardware or software.
Beware that the most effective way for someone to decrypt your data
may be with a rubber hose.
LEGAL ISSUES
As far as I am concerned, anyone is permitted to use this software
freely. However, see the file COPYING for detailed copying,
licensing, and distribution information.
In some countries, particularly France, Russia, Iraq, and Pakistan,
it may be illegal to use any encryption at all without a special
permit, and the rumor has it that you cannot get a permit for any
strong encryption.
This software may be freely imported into the United States; however,
the United States Government may consider re-exporting it a criminal
offence.
Note that any information and cryptographic algorithms used in this
software are publicly available on the Internet and at any major
bookstore, scientific library, or patent office worldwide.
THERE IS NO WARRANTY FOR THIS PROGRAM. Please consult the file
COPYING for more information.
MAILING LISTS AND OTHER INFORMATION
There is a mailing list for ossh. It is [email protected]. If you would
like to join, send a message to [email protected] with "subscribe
ssh" in body.
The WWW home page for ssh is http://www.cs.hut.fi/ssh. It contains an
archive of the mailing list, and detailed information about new
releases, mailing lists, and other relevant issues.
Bug reports should be sent to [email protected].
ABOUT THE AUTHOR
This software was written by Tatu Ylonen <[email protected]>. I work as a
researcher at Helsinki University of Technology, Finland. For more
information, see http://www.cs.hut.fi/~ylo/. My PGP public key is
available via finger from [email protected] and from the key servers. I
prefer PGP encrypted mail.
The author can be contacted via ordinary mail at
Tatu Ylonen
Helsinki University of Technology
Otakaari 1
FIN-02150 ESPOO
Finland
Fax. +358-0-4513293
ACKNOWLEDGEMENTS
I thank Tero Kivinen, Timo Rinne, Janne Snabb, and Heikki Suonsivu for
their help and comments in the design, implementation and porting of
this software. I also thank numerous contributors, including but not
limited to Walker Aumann, Jurgen Botz, Hans-Werner Braun, Stephane
Bortzmeyer, Adrian Colley, Michael Cooper, David Dombek, Jerome
Etienne, Bill Fithen, Mark Fullmer, Bert Gijsbers, Andreas Gustafsson,
Michael Henits, Steve Johnson, Thomas Koenig, Felix Leitner, Gunnar
Lindberg, Andrew Macpherson, Marc Martinec, Paul Mauvais, Donald
McKillican, Leon Mlakar, Robert Muchsel, Mark Treacy, Bryan
O'Sullivan, Mikael Suokas, Ollivier Robert, Jakob Schlyter, Tomasz
Surmacz, Alvar Vinacua, Petri Virkkula, Michael Warfield, and
Cristophe Wolfhugel.
Thanks also go to Philip Zimmermann, whose PGP software and the
associated legal battle provided inspiration, motivation, and many
useful techniques, and to Bruce Schneier whose book Applied
Cryptography has done a great service in widely distributing knowledge
about cryptographic methods.
Copyright (c) 1995 Tatu Ylonen, Espoo, Finland.
+563
View File
@@ -0,0 +1,563 @@
Ssh (Secure Shell) is a program to log into another computer over a
network, to execute commands in a remote machine, and to move files
from one machine to another. It provides strong authentication and
secure communications over insecure channels. It is inteded as a
replacement for rlogin, rsh, rcp, and rdist.
See the file INSTALL for installation instructions. See COPYING for
license terms and other legal issues. See RFC for a description of
the protocol. There is a WWW page for ssh; see http://www.cs.hut.fi/ssh.
This file has been updated to match ssh-1.2.12.
FEATURES
o Strong authentication. Closes several security holes (e.g., IP,
routing, and DNS spoofing). New authentication methods: .rhosts
together with RSA based host authentication, and pure RSA
authentication.
o Improved privacy. All communications are automatically and
transparently encrypted. RSA is used for key exchange, and a
conventional cipher (normally IDEA, DES, or triple-DES) for
encrypting the session. Encryption is started before
authentication, and no passwords or other information is
transmitted in the clear. Encryption is also used to protect
against spoofed packets.
o Secure X11 sessions. The program automatically sets DISPLAY on
the server machine, and forwards any X11 connections over the
secure channel. Fake Xauthority information is automatically
generated and forwarded to the remote machine; the local client
automatically examines incoming X11 connections and replaces the
fake authorization data with the real data (never telling the
remote machine the real information).
o Arbitrary TCP/IP ports can be redirected through the encrypted channel
in both directions (e.g., for e-cash transactions).
o No retraining needed for normal users; everything happens
automatically, and old .rhosts files will work with strong
authentication if administration installs host key files.
o Never trusts the network. Minimal trust on the remote side of
the connection. Minimal trust on domain name servers. Pure RSA
authentication never trusts anything but the private key.
o Client RSA-authenticates the server machine in the beginning of
every connection to prevent trojan horses (by routing or DNS
spoofing) and man-in-the-middle attacks, and the server
RSA-authenticates the client machine before accepting .rhosts or
/etc/hosts.equiv authentication (to prevent DNS, routing, or
IP-spoofing).
o Host authentication key distribution can be centrally by the
administration, automatically when the first connection is made
to a machine (the key obtained on the first connection will be
recorded and used for authentication in the future), or manually
by each user for his/her own use. The central and per-user host
key repositories are both used and complement each other. Host
keys can be generated centrally or automatically when the software
is installed. Host authentication keys are typically 1024 bits.
o Any user can create any number of user authentication RSA keys for
his/her own use. Each user has a file which lists the RSA public
keys for which proof of possession of the corresponding private
key is accepted as authentication. User authentication keys are
typically 1024 bits.
o The server program has its own server RSA key which is
automatically regenerated every hour. This key is never saved in
any file. Exchanged session keys are encrypted using both the
server key and the server host key. The purpose of the separate
server key is to make it impossible to decipher a captured session by
breaking into the server machine at a later time; one hour from
the connection even the server machine cannot decipher the session
key. The key regeneration interval is configurable. The server
key is normally 768 bits.
o An authentication agent, running in the user's laptop or local
workstation, can be used to hold the user's RSA authentication
keys. Ssh automatically forwards the connection to the
authentication agent over any connections, and there is no need to
store the RSA authentication keys on any machine in the network
(except the user's own local machine). The authentication
protocols never reveal the keys; they can only be used to verify
that the user's agent has a certain key. Eventually the agent
could rely on a smart card to perform all authentication
computations.
o The software can be installed and used (with restricted
functionality) even without root privileges.
o The client is customizable in system-wide and per-user
configuration files. Most aspects of the client's operation can
be configured. Different options can be specified on a per-host basis.
o Automatically executes conventional rsh (after displaying a
warning) if the server machine is not running sshd.
o Optional compression of all data with gzip (including forwarded X11
and TCP/IP port data), which may result in significant speedups on
slow connections.
o Complete replacement for rlogin, rsh, and rcp.
WHY TO USE SECURE SHELL
Currently, almost all communications in computer networks are done
without encryption. As a consequence, anyone who has access to any
machine connected to the network can listen in on any communication.
This is being done by hackers, curious administrators, employers,
criminals, industrial spies, and governments. Some networks leak off
enough electromagnetic radiation that data may be captured even from a
distance.
When you log in, your password goes in the network in plain
text. Thus, any listener can then use your account to do any evil he
likes. Many incidents have been encountered worldwide where crackers
have started programs on workstations without the owners knowledge
just to listen to the network and collect passwords. Programs for
doing this are available on the Internet, or can be built by a
competent programmer in a few hours.
Any information that you type or is printed on your screen can be
monitored, recorded, and analyzed. For example, an intruder who has
penetrated a host connected to a major network can start a program
that listens to all data flowing in the network, and whenever it
encounters a 16-digit string, it checks if it is a valid credit card
number (using the check digit), and saves the number plus any
surrounding text (to catch expiration date and holder) in a file.
When the intruder has collected a few thousand credit card numbers, he
makes smallish mail-order purchases from a few thousand stores around
the world, and disappears when the goods arrive but before anyone
suspects anything.
Businesses have trade secrets, patent applications in preparation,
pricing information, subcontractor information, client data, personnel
data, financial information, etc. Currently, anyone with access to
the network (any machine on the network) can listen to anything that
goes in the network, without any regard to normal access restrictions.
Many companies are not aware that information can so easily be
recovered from the network. They trust that their data is safe
since nobody is supposed to know that there is sensitive information
in the network, or because so much other data is transferred in the
network. This is not a safe policy.
Individual persons also have confidential information, such as
diaries, love letters, health care documents, information about their
personal interests and habits, professional data, job applications,
tax reports, political documents, unpublished manuscripts, etc.
One should also be aware that economical intelligence and industrial
espionage has recently become a major priority of the intelligence
agencies of major governments. President Clinton recently assigned
economical espionage as the primary task of the CIA, and the French
have repeatedly been publicly boasting about their achievements on
this field.
There is also another frightening aspect about the poor security of
communications. Computer storage and analysis capability has
increased so much that it is feasible for governments, major
companies, and criminal organizations to automatically analyze,
identify, classify, and file information about millions of people over
the years. Because most of the work can be automated, the cost of
collecting this information is getting very low.
Government agencies may be able to monitor major communication
systems, telephones, fax, computer networks, etc., and passively
collect huge amounts of information about all people with any
significant position in the society. Most of this information is not
sensitive, and many people would say there is no harm in someone
getting that information. However, the information starts to get
sensitive when someone has enough of it. You may not mind someone
knowing what you bought from the shop one random day, but you might
not like someone knowing every small thing you have bought in the last
ten years.
If the government some day starts to move into a more totalitarian
direction (one should remember that Nazi Germany was created by
democratic elections), there is considerable danger of an ultimate
totalitarian state. With enough information (the automatically
collected records of an individual can be manually analyzed when the
person becomes interesting), one can form a very detailed picture of
the individual's interests, opinions, beliefs, habits, friends,
lovers, weaknesses, etc. This information can be used to 1) locate
any persons who might oppose the new system 2) use deception to
disturb any organizations which might rise against the government 3)
eliminate difficult individuals without anyone understanding what
happened. Additionally, if the government can monitor communications
too effectively, it becomes too easy to locate and eliminate any
persons distributing information contrary to the official truth.
Fighting crime and terrorism are often used as grounds for domestic
surveillance and restricting encryption. These are good goals, but
there is considerable danger that the surveillance data starts to get
used for questionable purposes. I find that it is better to tolerate
a small amount of crime in the society than to let the society become
fully controlled. I am in favor of a fairly strong state, but the
state must never get so strong that people become unable to spread
contra-offical information and unable to overturn the government if it
is bad. The danger is that when you notice that the government is
too powerful, it is too late. Also, the real power may not be where
the official government is.
For these reasons (privacy, protecting trade secrets, and making it
more difficult to create a totalitarian state), I think that strong
cryptography should be integrated to the tools we use every day.
Using it causes no harm (except for those who wish to monitor
everything), but not using it can cause huge problems. If the society
changes in undesirable ways, then it will be to late to start
encrypting.
Encryption has had a "military" or "classified" flavor to it. There
are no longer any grounds for this. The military can and will use its
own encryption; that is no excuse to prevent the civilians from
protecting their privacy and secrets. Information on strong
encryption is available in every major bookstore, scientific library,
and patent office around the world, and strong encryption software is
available in every country on the Internet.
Some people would like to make it illegal to use encryption, or to
force people to use encryption that governments can break. This
approach offers no protection if the government turns bad. Also, the
"bad guys" will be using true strong encryption anyway. Good
encryption techniques are too widely known to make them disappear.
Thus, any "key escrow encryption" or other restrictions will only help
monitor ordinary people and petty criminals. It does not help against
powerful criminals, terrorists, or espionage, because they will know
how to use strong encryption anyway. (One source for internationally
available encryption software is http://www.cs.hut.fi/crypto.)
OVERVIEW OF SECURE SHELL
The software consists of a number of programs.
sshd Server program run on the server machine. This
listens for connections from client machines, and
whenever it receives a connection, it performs
authentication and starts serving the client.
ssh This is the client program used to log into another
machine or to execute commands on the other machine.
"slogin" is another name for this program.
scp Securely copies files from one machine to another.
ssh-keygen Used to create RSA keys (host keys and user
authentication keys).
ssh-agent Authentication agent. This can be used to hold RSA
keys for authentication.
ssh-add Used to register new keys with the agent.
make-ssh-known-hosts
Used to create the /etc/ssh_known_hosts file.
Ssh is the program users normally use. It is started as
ssh host
or
ssh host command
The first form opens a new shell on the remote machine (after
authentication). The latter form executes the command on the remote
machine.
When started, the ssh connects sshd on the server machine, verifies
that the server machine really is the machine it wanted to connect,
exchanges encryption keys (in a manner which prevents an outside
listener from getting the keys), performs authentication using .rhosts
and /etc/hosts.equiv, RSA authentication, or conventional password
based authentication. The server then (normally) allocates a
pseudo-terminal and starts an interactive shell or user program.
The TERM environment variable (describing the type of the user's
terminal) is passed from the client side to the remote side. Also,
terminal modes will be copied from the client side to the remote side
to preserve user preferences (e.g., the erase character).
If the DISPLAY variable is set on the client side, the server will
create a dummy X server and set DISPLAY accordingly. Any connections
to the dummy X server will be forwarded through the secure channel,
and will be made to the real X server from the client side. An
arbitrary number of X programs can be started during the session, and
starting them does not require anything special from the user. (Note
that the user must not manually set DISPLAY, because then it would
connect directly to the real display instead of going through the
encrypted channel). This behavior can be disabled in the
configuration file or by giving the -x option to the client.
Arbitrary IP ports can be forwarded over the secure channel. The
program then creates a port on one side, and whenever a connection is
opened to this port, it will be passed over the secure channel, and a
connection will be made from the other side to a specified host:port
pair. Arbitrary IP forwarding must always be explicitly requested,
and cannot be used to forward privileged ports (unless the user is
root). It is possible to specify automatic forwards in a per-user
configuration file, for example to make electronic cash systems work
securely.
If there is an authentication agent on the client side, connection to
it will be automatically forwarded to the server side.
For more infomation, see the manual pages ssh(1), sshd(8), scp(1),
ssh-keygen(1), ssh-agent(1), ssh-add(1), and make-ssh-known-hosts(1)
included in this distribution.
X11 CONNECTION FORWARDING
X11 forwarding serves two purposes: it is a convenience to the user
because there is no need to set the DISPLAY variable, and it provides
encrypted X11 connections. I cannot think of any other easy way to
make X11 connections encrypted; modifying the X server, clients or
libraries would require special work for each machine, vendor and
application. Widely used IP-level encryption does not seem likely for
several years. Thus what we have left is faking an X server on the
same machine where the clients are run, and forwarding the connections
to a real X server over the secure channel.
X11 forwarding works as follows. The client extracts Xauthority
information for the server. It then creates random authorization
data, and sends the random data to the server. The server allocates
an X11 display number, and stores the (fake) Xauthority data for this
display. Whenever an X11 connection is opened, the server forwards
the connection over the secure channel to the client, and the client
parses the first packet of the X11 protocol, substitutes real
authentication data for the fake data (if the fake data matched), and
forwards the connection to the real X server.
If the display does not have Xauthority data, the server will create a
unix domain socket in /tmp/.X11-unix, and use the unix domain socket
as the display. No authentication information is forwarded in this
case. X11 connections are again forwarded over the secure channel.
To the X server the connections appear to come from the client
machine, and the server must have connections allowed from the local
machine. Using authentication data is always recommended because not
using it makes the display insecure. If XDM is used, it automatically
generates the authentication data.
One should be careful not to use "xin" or "xstart" or other similar
scripts that explicitly set DISPLAY to start X sessions in a remote
machine, because the connection will then not go over the secure
channel. The recommended way to start a shell in a remote machine is
xterm -e ssh host &
and the recommended way to execute an X11 application in a remote
machine is
ssh -n host emacs &
If you need to type a password/passphrase for the remote machine,
ssh -f host emacs
may be useful.
RSA AUTHENTICATION
RSA authentication is based on public key cryptograpy. The idea is
that there are two encryption keys, one for encryption and another for
decryption. It is not possible (on human timescale) to derive the
decryption key from the encryption key. The encryption key is called
the public key, because it can be given to anyone and it is not
secret. The decryption key, on the other hand, is secret, and is
called the private key.
RSA authentication is based on the impossibility of deriving the
private key from the public key. The public key is stored on the
server machine in the user's $HOME/.ssh/authorized_keys file. The
private key is only kept on the user's local machine, laptop, or other
secure storage. Then the user tries to log in, the client tells the
server the public key that the user wishes to use for authentication.
The server then checks if this public key is admissible. If so, it
generates a 256 bit random number, encrypts it with the public key,
and sends the value to the client. The client then decrypts the
number with its private key, computes a 128 bit MD5 checksum from the
resulting data, and sends the checksum back to the server. (Only a
checksum is sent to prevent chosen-plaintext attacks against RSA.)
The server checks computes a checksum from the correct data,
and compares the checksums. Authentication is accepted if the
checksums match. (Theoretically this indicates that the client
only probably knows the correct key, but for all practical purposes
there is no doubt.)
The RSA private key can be protected with a passphrase. The
passphrase can be any string; it is hashed with MD5 to produce an
encryption key for IDEA, which is used to encrypt the private part of
the key file. With passphrase, authorization requires access to the key
file and the passphrase. Without passphrase, authorization only
depends on possession of the key file.
RSA authentication is the most secure form of authentication supported
by this software. It does not rely on the network, routers, domain
name servers, or the client machine. The only thing that matters is
access to the private key.
All this, of course, depends on the security of the RSA algorithm
itself. RSA has been widely known since about 1978, and no effective
methods for breaking it are known if it is used properly. Care has
been taken to avoid the well-known pitfalls. Breaking RSA is widely
believed to be equivalent to factoring, which is a very hard
mathematical problem that has received considerable public research.
So far, no effective methods are known for numbers bigger than about
512 bits. However, as computer speeds and factoring methods are
increasing, 512 bits can no longer be considered secure. The
factoring work is exponential, and 768 or 1024 bits are widely
considered to be secure in the near future.
RHOSTS AUTHENTICATION
Conventional .rhosts and hosts.equiv based authentication mechanisms
are fundamentally insecure due to IP, DNS (domain name server) and
routing spoofing attacks. Additionally this authentication method
relies on the integrity of the client machine. These weaknesses is
tolerable, and been known and exploited for a long time.
Ssh provides an improved version of these types of authentication,
because they are very convenient for the user (and allow easy
transition from rsh and rlogin). It permits these types of
authentication, but additionally requires that the client host be
authenticated using RSA.
The server has a list of host keys stored in /etc/ssh_known_host, and
additionally each user has host keys in $HOME/.ssh/known_hosts. Ssh
uses the name servers to obtain the canonical name of the client host,
looks for its public key in its known host files, and requires the
client to prove that it knows the private host key. This prevents IP
and routing spoofing attacks (as long as the client machine private
host key has not been compromized), but is still vulnerable to DNS
attacks (to a limited extent), and relies on the integrity of the
client machine as to who is requesting to log in. This prevents
outsiders from attacking, but does not protect against very powerful
attackers. If maximal security is desired, only RSA authentication
should be used.
It is possible to enable conventional .rhosts and /etc/hosts.equiv
authentication (without host authentication) at compile time by giving
the option --with-rhosts to configure. However, this is not
recommended, and is not done by default.
These weaknesses are present in rsh and rlogin. No improvement in
security will be obtained unless rlogin and rsh are completely
disabled (commented out in /etc/inetd.conf). This is highly
recommended.
WEAKEST LINKS IN SECURITY
One should understand that while this software may provide
cryptographically secure communications, it may be easy to
monitor the communications at their endpoints.
Basically, anyone with root access on the local machine on which you
are running the software may be able to do anything. Anyone with root
access on the server machine may be able to monitor your
communications, and a very talented root user might even be able to
send his/her own requests to your authentication agent.
One should also be aware that computers send out electromagnetic
radition that can sometimes be picked up hundreds of meters away.
Your keyboard is particularly easy to listen to. The image on your
monitor might also be seen on another monitor in a van parked behind
your house.
Beware that unwanted visitors might come to your home or office and
use your machine while you are away. They might also make
modifications or install bugs in your hardware or software.
Beware that the most effective way for someone to decrypt your data
may be with a rubber hose.
LEGAL ISSUES
As far as I am concerned, anyone is permitted to use this software
freely. However, see the file COPYING for detailed copying,
licensing, and distribution information.
In some countries, particularly France, Russia, Iraq, and Pakistan,
it may be illegal to use any encryption at all without a special
permit, and the rumor has it that you cannot get a permit for any
strong encryption.
This software may be freely imported into the United States; however,
the United States Government may consider re-exporting it a criminal
offence.
Note that any information and cryptographic algorithms used in this
software are publicly available on the Internet and at any major
bookstore, scientific library, or patent office worldwide.
THERE IS NO WARRANTY FOR THIS PROGRAM. Please consult the file
COPYING for more information.
MAILING LISTS AND OTHER INFORMATION
There is a mailing list for ossh. It is [email protected]. If you would
like to join, send a message to [email protected] with "subscribe
ssh" in body.
The WWW home page for ssh is http://www.cs.hut.fi/ssh. It contains an
archive of the mailing list, and detailed information about new
releases, mailing lists, and other relevant issues.
Bug reports should be sent to [email protected].
ABOUT THE AUTHOR
This software was written by Tatu Ylonen <[email protected]>. I work as a
researcher at Helsinki University of Technology, Finland. For more
information, see http://www.cs.hut.fi/~ylo/. My PGP public key is
available via finger from [email protected] and from the key servers. I
prefer PGP encrypted mail.
The author can be contacted via ordinary mail at
Tatu Ylonen
Helsinki University of Technology
Otakaari 1
FIN-02150 ESPOO
Finland
Fax. +358-0-4513293
ACKNOWLEDGEMENTS
I thank Tero Kivinen, Timo Rinne, Janne Snabb, and Heikki Suonsivu for
their help and comments in the design, implementation and porting of
this software. I also thank numerous contributors, including but not
limited to Walker Aumann, Jurgen Botz, Hans-Werner Braun, Stephane
Bortzmeyer, Adrian Colley, Michael Cooper, David Dombek, Jerome
Etienne, Bill Fithen, Mark Fullmer, Bert Gijsbers, Andreas Gustafsson,
Michael Henits, Steve Johnson, Thomas Koenig, Felix Leitner, Gunnar
Lindberg, Andrew Macpherson, Marc Martinec, Paul Mauvais, Donald
McKillican, Leon Mlakar, Robert Muchsel, Mark Treacy, Bryan
O'Sullivan, Mikael Suokas, Ollivier Robert, Jakob Schlyter, Tomasz
Surmacz, Alvar Vinacua, Petri Virkkula, Michael Warfield, and
Cristophe Wolfhugel.
Thanks also go to Philip Zimmermann, whose PGP software and the
associated legal battle provided inspiration, motivation, and many
useful techniques, and to Bruce Schneier whose book Applied
Cryptography has done a great service in widely distributing knowledge
about cryptographic methods.
Copyright (c) 1995 Tatu Ylonen, Espoo, Finland.
-44
View File
@@ -1,44 +0,0 @@
This is a Linux port of OpenBSD's excellent OpenSSH.
OpenSSH is based on the last free version of Tatu Ylonen's SSH with all
patent-encumbered algorithms removed, all known security bugs fixed, new
features reintroduced and many other clean-ups.
This Linux port basically consists of a few fixes to deal with the way that
OpenSSL is usually installed on Linux systems, a few replacements for
OpenBSD library functions and the introduction of partial PAM support.
The PAM support is less than optimal - it is only used when password
authentication is requested, so things like pam_limits will not apply if a
user authenticates with a RSA key. OTOH this is exactly the level of support
that the popular Linux SSH packages have. Perhaps a PAM hacker can rectify
this?
All new code is released under a XFree style license, which is very liberal.
This code is released with no warranties of any kind, neither I nor my
employer (Internet Business Solutions) will take any responsibility for
any loss, damage or liability arising from the use or abuse of this software.
OpenSSH depends on Zlib, OpenSSL and PAM. Use the Makefile.GNU to build it.
Damien Miller <[email protected]>
Internet Business Solutions
Credits -
The OpenBSD team
'jonchen' - the original author of PAM support of SSH
Miscellania -
This version of SSH is based upon code retrieved from the OpenBSD CVS
repository on 1999-10-26, which in turn was based on the last free
version of SSH released by Tatu Ylonen.
Code in helper.[ch] is Copyright 1999 Internet Business Solutions and
is released under a X11-style license (see source file for details).
(A)RC4 code in rc4.[ch] is Copyright 1999 Damien Miller. It too is
under a X11-style license (see source file for details).
+7
View File
@@ -0,0 +1,7 @@
/* config.h.in. Generated by hand, don't use autoheader. */
/* Define if your ssl headers are included with #include <ssl/header.h> */
#undef HAVE_SSL
/* Define if your ssl headers are included with #include <openssl/header.h> */
#undef HAVE_OPENSSL
+8 -1
View File
@@ -15,8 +15,9 @@ validity of the host key.
*/
#include "config.h"
#include "includes.h"
RCSID("$Id: auth-rsa.c,v 1.1 1999/10/27 03:42:43 damien Exp $");
RCSID("$Id: auth-rsa.c,v 1.3 1999/10/28 05:23:30 damien Exp $");
#include "rsa.h"
#include "packet.h"
@@ -25,8 +26,14 @@ RCSID("$Id: auth-rsa.c,v 1.1 1999/10/27 03:42:43 damien Exp $");
#include "mpaux.h"
#include "uidswap.h"
#ifdef HAVE_OPENSSL
#include <openssl/rsa.h>
#include <openssl/md5.h>
#endif
#ifdef HAVE_SSL
#include <ssl/rsa.h>
#include <ssl/md5.h>
#endif
/* Flags that may be set in authorized_keys options. */
extern int no_port_forwarding_flag;
+7 -1
View File
@@ -13,8 +13,9 @@ Functions for connecting the local authentication agent.
*/
#include "config.h"
#include "includes.h"
RCSID("$Id: authfd.c,v 1.1 1999/10/27 03:42:43 damien Exp $");
RCSID("$Id: authfd.c,v 1.2 1999/10/28 03:25:17 damien Exp $");
#include "ssh.h"
#include "rsa.h"
@@ -24,7 +25,12 @@ RCSID("$Id: authfd.c,v 1.1 1999/10/27 03:42:43 damien Exp $");
#include "xmalloc.h"
#include "getput.h"
#ifdef HAVE_OPENSSL
#include <openssl/rsa.h>
#endif
#ifdef HAVE_SSL
#include <ssl/rsa.h>
#endif
/* Returns the number of the authentication fd, or -1 if there is none. */
+8 -1
View File
@@ -14,10 +14,17 @@ for reading the passphrase from the user.
*/
#include "config.h"
#include "includes.h"
RCSID("$Id: authfile.c,v 1.1 1999/10/27 03:42:43 damien Exp $");
RCSID("$Id: authfile.c,v 1.2 1999/10/28 03:25:17 damien Exp $");
#ifdef HAVE_OPENSSL
#include <openssl/bn.h>
#endif
#ifdef HAVE_SSL
#include <ssl/bn.h>
#endif
#include "xmalloc.h"
#include "buffer.h"
#include "bufaux.h"
+9 -1
View File
@@ -14,11 +14,19 @@ Buffers.
*/
#include "config.h"
#include "includes.h"
RCSID("$Id: bufaux.c,v 1.1 1999/10/27 03:42:43 damien Exp $");
RCSID("$Id: bufaux.c,v 1.2 1999/10/28 03:25:17 damien Exp $");
#include "ssh.h"
#ifdef HAVE_OPENSSL
#include <openssl/bn.h>
#endif
#ifdef HAVE_SSL
#include <ssl/bn.h>
#endif
#include "bufaux.h"
#include "xmalloc.h"
#include "getput.h"
+37 -41
View File
@@ -16,7 +16,7 @@ arbitrary tcp/ip connections, and the authentication agent connection.
*/
#include "includes.h"
RCSID("$Id: channels.c,v 1.1 1999/10/27 03:42:44 damien Exp $");
RCSID("$Id: channels.c,v 1.3 1999/10/30 01:39:56 damien Exp $");
#include "ssh.h"
#include "packet.h"
@@ -108,7 +108,8 @@ void channel_permit_all_opens()
int channel_allocate(int type, int sock, char *remote_name)
{
int i, old_channels;
int i, found;
Channel *c;
/* Update the maximum file descriptor value. */
if (sock > channel_max_fd_value)
@@ -128,41 +129,37 @@ int channel_allocate(int type, int sock, char *remote_name)
}
/* Try to find a free slot where to put the new channel. */
for (i = 0; i < channels_alloc; i++)
for (found = -1, i = 0; i < channels_alloc; i++)
if (channels[i].type == SSH_CHANNEL_FREE)
{
/* Found a free slot. Initialize the fields and return its number. */
buffer_init(&channels[i].input);
buffer_init(&channels[i].output);
channels[i].self = i;
channels[i].type = type;
channels[i].x11 = 0;
channels[i].sock = sock;
channels[i].remote_id = -1;
channels[i].remote_name = remote_name;
chan_init_iostates(&channels[i]);
return i;
/* Found a free slot. */
found = i;
break;
}
/* There are no free slots. Must expand the array. */
old_channels = channels_alloc;
channels_alloc += 10;
channels = xrealloc(channels, channels_alloc * sizeof(Channel));
for (i = old_channels; i < channels_alloc; i++)
channels[i].type = SSH_CHANNEL_FREE;
if (found == -1)
{
/* There are no free slots. Take last+1 slot and expand the array. */
found = channels_alloc;
channels_alloc += 10;
debug("channel: expanding %d", channels_alloc);
channels = xrealloc(channels, channels_alloc * sizeof(Channel));
for (i = found; i < channels_alloc; i++)
channels[i].type = SSH_CHANNEL_FREE;
}
/* We know that the next one after the old maximum channel number is now
available. Initialize and return its number. */
buffer_init(&channels[old_channels].input);
buffer_init(&channels[old_channels].output);
channels[old_channels].self = old_channels;
channels[old_channels].type = type;
channels[old_channels].x11 = 0;
channels[old_channels].sock = sock;
channels[old_channels].remote_id = -1;
channels[old_channels].remote_name = remote_name;
chan_init_iostates(&channels[old_channels]);
return old_channels;
/* Initialize and return new channel number. */
c=&channels[found];
buffer_init(&c->input);
buffer_init(&c->output);
chan_init_iostates(c);
c->self = found;
c->type = type;
c->sock = sock;
c->remote_id = -1;
c->remote_name = remote_name;
debug("channel %d: new [%s]", found, remote_name);
return found;
}
/* Free the channel and close its socket. */
@@ -318,8 +315,6 @@ void channel_prepare_select(fd_set *readset, fd_set *writeset)
/* Start normal processing for the channel. */
ch->type = SSH_CHANNEL_OPEN;
/* Enable X11 Problem FIX */
ch->x11 = 1;
goto redo;
reject:
@@ -336,10 +331,10 @@ void channel_prepare_select(fd_set *readset, fd_set *writeset)
packet_put_int(ch->remote_id);
packet_send();
}else{
debug("X11 rejected %d 0x%x 0x%x", ch->self, ch->istate, ch->ostate);
debug("X11 rejected %d i%d/o%d", ch->self, ch->istate, ch->ostate);
chan_read_failed(ch);
chan_write_failed(ch);
debug("X11 rejected %d 0x%x 0x%x", ch->self, ch->istate, ch->ostate);
debug("X11 rejected %d i%d/o%d", ch->self, ch->istate, ch->ostate);
}
break;
@@ -407,9 +402,9 @@ void channel_after_select(fd_set *readset, fd_set *writeset)
break;
}
remote_hostname = get_remote_hostname(newsock);
snprintf(buf, sizeof buf, "port %d, connection from %.200s port %d",
ch->listening_port, remote_hostname,
get_peer_port(newsock));
snprintf(buf, sizeof buf, "listen port %d:%.100s:%d, connect from %.200s:%d",
ch->listening_port, ch->path, ch->host_port,
remote_hostname, get_peer_port(newsock));
xfree(remote_hostname);
newch = channel_allocate(SSH_CHANNEL_OPENING, newsock,
xstrdup(buf));
@@ -830,8 +825,9 @@ char *channel_open_message()
case SSH_CHANNEL_X11_OPEN:
case SSH_CHANNEL_INPUT_DRAINING:
case SSH_CHANNEL_OUTPUT_DRAINING:
snprintf(buf, sizeof buf, " #%d/%d %.300s\r\n",
c->self,c->type,c->remote_name);
snprintf(buf, sizeof buf, " #%d %.300s (t%d r%d i%d o%d)\r\n",
c->self,c->remote_name,
c->type,c->remote_id, c->istate,c->ostate);
buffer_append(&buffer, buf, strlen(buf));
continue;
default:
+3 -4
View File
@@ -1,4 +1,4 @@
/* RCSID("$Id: channels.h,v 1.1 1999/10/27 03:42:44 damien Exp $"); */
/* RCSID("$Id: channels.h,v 1.2 1999/10/30 01:39:56 damien Exp $"); */
#ifndef CHANNELS_H
#define CHANNELS_H
@@ -26,9 +26,8 @@ typedef struct Channel
int self; /* my own channel identifier */
int remote_id; /* channel identifier for remote peer */
/* peer can be reached over encrypted connection, via packet-sent */
int istate;
int ostate;
int x11;
int istate; /* input from channel (state of receive half) */
int ostate; /* output to channel (state of transmit half) */
int sock; /* data socket, linked to this channel */
Buffer input; /* data read from socket, to be sent over encrypted connection */
Buffer output; /* data received over encrypted connection for send on socket */
+7 -1
View File
@@ -11,13 +11,19 @@ Created: Wed Apr 19 17:41:39 1995 ylo
*/
#include "config.h"
#include "includes.h"
RCSID("$Id: cipher.c,v 1.1 1999/10/27 03:42:44 damien Exp $");
RCSID("$Id: cipher.c,v 1.3 1999/10/28 05:23:30 damien Exp $");
#include "ssh.h"
#include "cipher.h"
#ifdef HAVE_OPENSSL
#include <openssl/md5.h>
#endif
#ifdef HAVE_SSL
#include <ssl/md5.h>
#endif
/*
* What kind of tripple DES are these 2 routines?
+9 -1
View File
@@ -11,13 +11,21 @@ Created: Wed Apr 19 16:50:42 1995 ylo
*/
/* RCSID("$Id: cipher.h,v 1.1 1999/10/27 03:42:44 damien Exp $"); */
/* RCSID("$Id: cipher.h,v 1.2 1999/10/28 03:25:17 damien Exp $"); */
#include "config.h"
#ifndef CIPHER_H
#define CIPHER_H
#ifdef HAVE_OPENSSL
#include <openssl/des.h>
#include <openssl/blowfish.h>
#endif
#ifdef HAVE_SSL
#include <ssl/des.h>
#include <ssl/blowfish.h>
#endif
/* Cipher types. New types can be added, but old types should not be removed
for compatibility. The maximum allowed value is 31. */
+142
View File
@@ -0,0 +1,142 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define to empty if the keyword does not work. */
#undef const
/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t
/* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT
/* Define if your struct stat has st_blksize. */
#undef HAVE_ST_BLKSIZE
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
/* Define if utime(file, NULL) sets file's timestamp to the present. */
#undef HAVE_UTIME_NULL
/* Define if you have the vprintf function. */
#undef HAVE_VPRINTF
/* Define as __inline if that's what the C compiler calls it. */
#undef inline
/* Define to `int' if <sys/types.h> doesn't define. */
#undef mode_t
/* Define to `long' if <sys/types.h> doesn't define. */
#undef off_t
/* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t
/* Define if your ssl headers are included with #include <ssl/header.h> */
#undef HAVE_SSL
/* Define if your ssl headers are included with #include <openssl/header.h> */
#undef HAVE_OPENSSL
/* Define if you have the arc4random function. */
#undef HAVE_ARC4RANDOM
/* Define if you have the gethostname function. */
#undef HAVE_GETHOSTNAME
/* Define if you have the gettimeofday function. */
#undef HAVE_GETTIMEOFDAY
/* Define if you have the mkdir function. */
#undef HAVE_MKDIR
/* Define if you have the mkdtemp function. */
#undef HAVE_MKDTEMP
/* Define if you have the rmdir function. */
#undef HAVE_RMDIR
/* Define if you have the select function. */
#undef HAVE_SELECT
/* Define if you have the setproctitle function. */
#undef HAVE_SETPROCTITLE
/* Define if you have the socket function. */
#undef HAVE_SOCKET
/* Define if you have the strerror function. */
#undef HAVE_STRERROR
/* Define if you have the strlcpy function. */
#undef HAVE_STRLCPY
/* Define if you have the strspn function. */
#undef HAVE_STRSPN
/* Define if you have the strtol function. */
#undef HAVE_STRTOL
/* Define if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define if you have the <ndir.h> header file. */
#undef HAVE_NDIR_H
/* Define if you have the <paths.h> header file. */
#undef HAVE_PATHS_H
/* Define if you have the <sys/dir.h> header file. */
#undef HAVE_SYS_DIR_H
/* Define if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
/* Define if you have the <sys/ndir.h> header file. */
#undef HAVE_SYS_NDIR_H
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if you have the crypto library (-lcrypto). */
#undef HAVE_LIBCRYPTO
/* Define if you have the dl library (-ldl). */
#undef HAVE_LIBDL
/* Define if you have the nsl library (-lnsl). */
#undef HAVE_LIBNSL
/* Define if you have the pam library (-lpam). */
#undef HAVE_LIBPAM
/* Define if you have the pwdb library (-lpwdb). */
#undef HAVE_LIBPWDB
/* Define if you have the util library (-lutil). */
#undef HAVE_LIBUTIL
/* Define if you have the z library (-lz). */
#undef HAVE_LIBZ
+57
View File
@@ -0,0 +1,57 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(auth-krb4.c)
AC_CONFIG_HEADER(config.h)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_RANLIB
dnl Checks for libraries.
dnl Replace `main' with a function in -lcrypto:
AC_CHECK_LIB(crypto, CRYPTO_lock, ,AC_MSG_ERROR([*** libcrypto missing - please install first ***]))
dnl Replace `main' with a function in -lutil:
AC_CHECK_LIB(util, logout, ,AC_MSG_ERROR([*** -lutil missing - this is part of libc. ***]))
dnl Replace `main' with a function in -lz:
AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
dnl check for nsl
AC_CHECK_LIB(nsl, yp_match, , )
dnl check for pwdb
AC_CHECK_LIB(pwdb, pwdb_new, , )
dnl check for dl
AC_CHECK_LIB(dl, dlopen, ,AC_MSG_ERROR([*** libdl missing - please install first ***]))
dnl check for pam
AC_CHECK_LIB(pam, pam_authenticate, ,AC_MSG_ERROR([*** PAM missing - please install first ***]))
dnl Check for stuff in path.
AC_CHECK_PROG(AR, ar, ar)
AC_CHECK_PROG(RANLIB, ranlib, ranlib)
dnl Check for ssl headers
AC_CHECK_HEADER(openssl/bn.h, [AC_DEFINE(HAVE_OPENSSL)], [AC_CHECK_HEADER(ssl/bn.h, [AC_DEFINE(HAVE_SSL)], [AC_MSG_ERROR([*** ssl library missing - please install first ***])])])
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h paths.h sys/ioctl.h sys/time.h syslog.h unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_UID_T
AC_C_INLINE
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_STRUCT_ST_BLKSIZE
AC_HEADER_TIME
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(gethostname gettimeofday mkdir rmdir select socket strerror strspn strtol strlcpy mkdtemp arc4random setproctitle)
AC_OUTPUT(Makefile)
+10 -6
View File
@@ -45,18 +45,15 @@
#include "rc4.h"
#include "xmalloc.h"
#include "config.h"
#include "helper.h"
#ifndef HAVE_ARC4RANDOM
void get_random_bytes(unsigned char *buf, int len);
static rc4_t *rc4 = NULL;
void setproctitle(const char *fmt, ...)
{
/* FIXME */
}
unsigned int arc4random(void)
{
unsigned int r;
@@ -105,4 +102,11 @@ void get_random_bytes(unsigned char *buf, int len)
exit(1);
}
}
#endif /* !HAVE_ARC4RANDOM */
#ifndef HAVE_SETPROCTITLE
void setproctitle(const char *fmt, ...)
{
/* FIXME */
}
#endif /* !HAVE_SETPROCTITLE */
+7
View File
@@ -36,8 +36,15 @@
#ifndef _HELPER_H
#define _HELPER_H
#include "config.h"
#ifndef HAVE_ARC4RANDOM
unsigned int arc4random(void);
void arc4random_stir(void);
#endif /* !HAVE_ARC4RANDOM */
#ifndef HAVE_SETPROCTITLE
void setproctitle(const char *fmt, ...);
#endif /* !HAVE_SETPROCTITLE */
#endif /* _HELPER_H */
+4 -8
View File
@@ -57,15 +57,17 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
#include "version.h"
#include "config.h"
#include "helper.h"
#include "mktemp.h"
#include "strlcpy.h"
#ifdef HAVE_PAM
#ifdef HAVE_LIBPAM
#include <security/pam_appl.h>
#endif /* HAVE_PAM */
#ifdef HAVE_PWDB
#ifdef HAVE_LIBPWDB
#include <pwdb/pwdb_map.h>
#endif /* HAVE_PWDB */
@@ -83,10 +85,4 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
client program. Socketpairs do not seem to work on all systems. */
#define USE_PIPES 1
#ifndef SHUT_RD
#define SHUT_RD 0
#define SHUT_WR 1
#define SHUT_RDWR 2
#endif /* SHUT_RD */
#endif /* INCLUDES_H */
+5
View File
@@ -47,8 +47,11 @@ static char rcsid[] = "$OpenBSD: mktemp.c,v 1.13 1998/06/30 23:03:13 deraadt Exp
#include <ctype.h>
#include <unistd.h>
#include "config.h"
#include "helper.h"
#ifndef HAVE_MKDTEMP
static int _gettemp __P((char *, int *, int, int));
int
@@ -181,3 +184,5 @@ _gettemp(path, doopen, domkdir, slen)
}
/*NOTREACHED*/
}
#endif /* !HAVE_MKDTEMP */
+4
View File
@@ -1,7 +1,11 @@
#ifndef _MKTEMP_H
#define _MKTEMP_H
#include "config.h"
#ifndef HAVE_MKDTEMP
int mkstemps(char *path, int slen);
int mkstemp(char *path);
char *mkdtemp(char *path);
#endif /* !HAVE_MKDTEMP */
#endif /* _MKTEMP_H */
+10 -2
View File
@@ -14,14 +14,22 @@ precision integers.
*/
#include "config.h"
#include "includes.h"
RCSID("$Id: mpaux.c,v 1.1 1999/10/27 03:42:44 damien Exp $");
RCSID("$Id: mpaux.c,v 1.3 1999/10/28 05:23:30 damien Exp $");
#ifdef HAVE_OPENSSL
#include <openssl/bn.h>
#include <openssl/md5.h>
#endif
#ifdef HAVE_SSL
#include <ssl/bn.h>
#include <ssl/md5.h>
#endif
#include "getput.h"
#include "xmalloc.h"
#include <openssl/md5.h>
void
compute_session_id(unsigned char session_id[16],
+2 -2
View File
@@ -50,9 +50,9 @@ Notes
The input buffer is filled with data from the socket
(the socket represents the local comsumer/producer of the
forwarded channel).
The data is then sent over the INPUT-end of the channel to the
The data is then sent over the INPUT-end (transmit-end) of the channel to the
remote peer.
Data sent by the peer is received on the OUTPUT-end,
Data sent by the peer is received on the OUTPUT-end (receive-end),
saved in the output buffer and written to the socket.
.PP
If the local protocol instance has forwarded all data on the
+21 -13
View File
@@ -1,6 +1,6 @@
Summary: OpenSSH free Secure Shell (SSH) implementation
Name: openssh
Version: 1.2pre3
Version: 1.2pre7
Release: 1
Packager: Damien Miller <[email protected]>
Source0: openssh-%{version}-linux.tar.gz
@@ -20,6 +20,13 @@ up to date in terms of security and features, as well as removing all
patented algorithms to seperate libraries (OpenSSL).
%changelog
* Sat Oct 30 1999 Damien Miller <[email protected]>
- Renamed init script
* Fri Oct 29 1999 Damien Miller <[email protected]>
- Back to old binary names
* Thu Oct 28 1999 Damien Miller <[email protected]>
- Use autoconf
- New binary names
* Wed Oct 27 1999 Damien Miller <[email protected]>
- Initial RPMification, based on Jan "Yenya" Kasprzak's <[email protected]> spec.
@@ -29,7 +36,8 @@ patented algorithms to seperate libraries (OpenSSL).
%build
make -f Makefile.GNU OPT_FLAGS="$RPM_OPT_FLAGS"
./configure --prefix=/usr --sysconfdir=/etc/ssh
make OPT_FLAGS="$RPM_OPT_FLAGS"
%install
rm -rf $RPM_BUILD_ROOT
@@ -41,17 +49,17 @@ mkdir -p $RPM_BUILD_ROOT/etc/ssh
mkdir -p $RPM_BUILD_ROOT/usr/man/man1
mkdir -p $RPM_BUILD_ROOT/usr/man/man8
install -m644 ssh.pam $RPM_BUILD_ROOT/etc/pam.d/ssh
install -m755 sshd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/sshd
install -m644 sshd.pam $RPM_BUILD_ROOT/etc/pam.d/sshd
install -m755 sshd.init.redhat $RPM_BUILD_ROOT/etc/rc.d/init.d/sshd
install -m600 ssh_config $RPM_BUILD_ROOT/etc/ssh/ssh_config
install -m600 sshd_config $RPM_BUILD_ROOT/etc/ssh/sshd_config
install -s -m755 bin/sshd $RPM_BUILD_ROOT/usr/sbin
install -s -m755 bin/ssh $RPM_BUILD_ROOT/usr/bin
install -s -m755 bin/scp $RPM_BUILD_ROOT/usr/bin
install -s -m755 bin/ssh-agent $RPM_BUILD_ROOT/usr/bin
install -s -m755 bin/ssh-add $RPM_BUILD_ROOT/usr/bin
install -s -m755 bin/ssh-keygen $RPM_BUILD_ROOT/usr/bin
install -s -m755 sshd $RPM_BUILD_ROOT/usr/sbin
install -s -m755 ssh $RPM_BUILD_ROOT/usr/bin
install -s -m755 scp $RPM_BUILD_ROOT/usr/bin
install -s -m755 ssh-agent $RPM_BUILD_ROOT/usr/bin
install -s -m755 ssh-add $RPM_BUILD_ROOT/usr/bin
install -s -m755 ssh-keygen $RPM_BUILD_ROOT/usr/bin
install -m644 sshd.8 $RPM_BUILD_ROOT/usr/man/man8
install -m644 ssh.1 $RPM_BUILD_ROOT/usr/man/man1
@@ -82,8 +90,8 @@ fi
%files
%defattr(-,root,root)
%doc COPYING.Ylonen ChangeLog ChangeLog.linux OVERVIEW
%doc README README.openssh
%doc COPYING.Ylonen ChangeLog ChangeLog.Ylonen OVERVIEW
%doc README README.Ylonen
%attr(0755,root,root) /usr/sbin/sshd
%attr(0755,root,root) /usr/bin/ssh
%attr(0755,root,root) /usr/bin/ssh-agent
@@ -99,7 +107,7 @@ fi
%attr(0755,root,root) /usr/man/man1/scp.1
%attr(0600,root,root) %config /etc/ssh/sshd_config
%attr(0600,root,root) %config /etc/pam.d/ssh
%attr(0600,root,root) %config /etc/pam.d/sshd
%attr(0755,root,root) %config /etc/rc.d/init.d/sshd
%attr(0644,root,root) %config /etc/ssh/ssh_config
+7 -1
View File
@@ -13,12 +13,18 @@ Interface for the packet protocol functions.
*/
/* RCSID("$Id: packet.h,v 1.1 1999/10/27 03:42:44 damien Exp $"); */
/* RCSID("$Id: packet.h,v 1.2 1999/10/28 03:25:17 damien Exp $"); */
#include "config.h"
#ifndef PACKET_H
#define PACKET_H
#ifdef HAVE_OPENSSL
#include <openssl/bn.h>
#endif
#ifdef HAVE_SSL
#include <ssl/bn.h>
#endif
/* Sets the socket used for communication. Disables encryption until
packet_set_encryption_key is called. It is permissible that fd_in
+4
View File
@@ -41,6 +41,9 @@
/* $Id: rc4.c,v 1.1.1.1 1999/10/26 05:48:13 damien Exp $ */
#include "config.h"
#ifndef HAVE_ARC4RANDOM
#include "rc4.h"
@@ -103,3 +106,4 @@ void rc4_getbytes(rc4_t *r, unsigned char *buffer, int len)
c++;
}
}
#endif /* !HAVE_ARC4RANDOM */
+5
View File
@@ -44,6 +44,9 @@
#ifndef _RC4_H
#define _RC4_H
#include "config.h"
#ifndef HAVE_ARC4RANDOM
/*! \struct rc4_t
\brief RC4 stream cipher state object
\var s State array
@@ -107,4 +110,6 @@ void rc4_crypt(rc4_t *r, unsigned char *plaintext, int len);
*/
void rc4_getbytes(rc4_t *r, unsigned char *buffer, int len);
#endif /* !HAVE_ARC4RANDOM */
#endif /* _RC4_H */
+9 -1
View File
@@ -13,13 +13,21 @@ RSA key generation, encryption and decryption.
*/
/* RCSID("$Id: rsa.h,v 1.1 1999/10/27 03:42:44 damien Exp $"); */
/* RCSID("$Id: rsa.h,v 1.2 1999/10/28 03:25:17 damien Exp $"); */
#include "config.h"
#ifndef RSA_H
#define RSA_H
#ifdef HAVE_OPENSSL
#include <openssl/bn.h>
#include <openssl/rsa.h>
#endif
#ifdef HAVE_SSL
#include <ssl/bn.h>
#include <ssl/rsa.h>
#endif
/* Calls SSL RSA_generate_key, only copies to prv and pub */
void rsa_generate_key(RSA *prv, RSA *pub, unsigned int bits);
+1 -1
View File
@@ -9,7 +9,7 @@
.\"
.\" Created: Sun May 7 00:14:37 1995 ylo
.\"
.\" $Id: scp.1,v 1.1 1999/10/27 03:42:44 damien Exp $
.\" $Id: scp.1,v 1.3 1999/10/28 23:15:49 damien Exp $
.\"
.Dd September 25, 1999
.Dt SCP 1
+4 -4
View File
@@ -42,11 +42,11 @@ and ssh has the necessary privileges.)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: scp.c,v 1.1 1999/10/27 03:42:45 damien Exp $
* $Id: scp.c,v 1.2 1999/10/28 05:23:30 damien Exp $
*/
#include "includes.h"
RCSID("$Id: scp.c,v 1.1 1999/10/27 03:42:45 damien Exp $");
RCSID("$Id: scp.c,v 1.2 1999/10/28 05:23:30 damien Exp $");
#include "ssh.h"
#include "xmalloc.h"
@@ -976,7 +976,7 @@ run_err(const char *fmt, ...)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: scp.c,v 1.1 1999/10/27 03:42:45 damien Exp $
* $Id: scp.c,v 1.2 1999/10/28 05:23:30 damien Exp $
*/
char *
@@ -1183,7 +1183,7 @@ progressmeter(int flag)
" - stalled -");
} else {
remaining = (int)(totalbytes / (statbytes / elapsed) - elapsed);
i = elapsed / 3600;
i = remaining / 3600;
if (i)
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
"%2d:", i);
+1 -1
View File
@@ -9,7 +9,7 @@
.\"
.\" Created: Sat Apr 22 23:55:14 1995 ylo
.\"
.\" $Id: ssh-add.1,v 1.1 1999/10/27 03:42:45 damien Exp $
.\" $Id: ssh-add.1,v 1.3 1999/10/28 23:15:49 damien Exp $
.\"
.Dd September 25, 1999
.Dt SSH-ADD 1
+26 -62
View File
@@ -14,7 +14,7 @@ Adds an identity to the authentication server, or removes an identity.
*/
#include "includes.h"
RCSID("$Id: ssh-add.c,v 1.1 1999/10/27 03:42:45 damien Exp $");
RCSID("$Id: ssh-add.c,v 1.2 1999/10/28 05:23:30 damien Exp $");
#include "rsa.h"
#include "ssh.h"
@@ -22,11 +22,10 @@ RCSID("$Id: ssh-add.c,v 1.1 1999/10/27 03:42:45 damien Exp $");
#include "authfd.h"
void
delete_file(const char *filename)
delete_file(AuthenticationConnection *ac, const char *filename)
{
RSA *key;
char *comment;
AuthenticationConnection *ac;
key = RSA_new();
if (!load_public_key(filename, key, &comment))
@@ -35,55 +34,29 @@ delete_file(const char *filename)
return;
}
/* Send the request to the authentication agent. */
ac = ssh_get_authentication_connection();
if (!ac)
{
fprintf(stderr,
"Could not open a connection to your authentication agent.\n");
RSA_free(key);
xfree(comment);
return;
}
if (ssh_remove_identity(ac, key))
fprintf(stderr, "Identity removed: %s (%s)\n", filename, comment);
else
fprintf(stderr, "Could not remove identity: %s\n", filename);
RSA_free(key);
xfree(comment);
ssh_close_authentication_connection(ac);
}
void
delete_all()
delete_all(AuthenticationConnection *ac)
{
AuthenticationConnection *ac;
/* Get a connection to the agent. */
ac = ssh_get_authentication_connection();
if (!ac)
{
fprintf(stderr,
"Could not open a connection to your authentication agent.\n");
return;
}
/* Send a request to remove all identities. */
if (ssh_remove_all_identities(ac))
fprintf(stderr, "All identities removed.\n");
else
fprintf(stderr, "Failed to remove all identitities.\n");
/* Close the connection to the agent. */
ssh_close_authentication_connection(ac);
}
void
add_file(const char *filename)
add_file(AuthenticationConnection *ac, const char *filename)
{
RSA *key;
RSA *public_key;
AuthenticationConnection *ac;
char *saved_comment, *comment, *pass;
int first;
@@ -131,40 +104,22 @@ add_file(const char *filename)
xfree(saved_comment);
/* Send the key to the authentication agent. */
ac = ssh_get_authentication_connection();
if (!ac)
{
fprintf(stderr,
"Could not open a connection to your authentication agent.\n");
RSA_free(key);
xfree(comment);
return;
}
if (ssh_add_identity(ac, key, comment))
fprintf(stderr, "Identity added: %s (%s)\n", filename, comment);
else
fprintf(stderr, "Could not add identity: %s\n", filename);
RSA_free(key);
xfree(comment);
ssh_close_authentication_connection(ac);
}
void
list_identities()
list_identities(AuthenticationConnection *ac)
{
AuthenticationConnection *ac;
BIGNUM *e, *n;
int bits, status;
char *comment;
int had_identities;
ac = ssh_get_authentication_connection();
if (!ac)
{
fprintf(stderr, "Could not connect to authentication server.\n");
return;
}
e = BN_new();
n = BN_new();
had_identities = 0;
@@ -189,12 +144,12 @@ list_identities()
BN_clear_free(n);
if (!had_identities)
printf("The agent has no identities.\n");
ssh_close_authentication_connection(ac);
}
int
main(int ac, char **av)
main(int argc, char **argv)
{
AuthenticationConnection *ac = NULL;
struct passwd *pw;
char buf[1024];
int no_files = 1;
@@ -211,30 +166,37 @@ main(int ac, char **av)
exit(1);
}
for (i = 1; i < ac; i++)
/* At first, get a connection to the authentication agent. */
ac = ssh_get_authentication_connection();
if (ac == NULL) {
fprintf(stderr, "Could not open a connection to your authentication agent.\n");
exit(1);
}
for (i = 1; i < argc; i++)
{
if (strcmp(av[i], "-l") == 0)
if (strcmp(argv[i], "-l") == 0)
{
list_identities();
list_identities(ac);
no_files = 0; /* Don't default-add/delete if -l. */
continue;
}
if (strcmp(av[i], "-d") == 0)
if (strcmp(argv[i], "-d") == 0)
{
deleting = 1;
continue;
}
if (strcmp(av[i], "-D") == 0)
if (strcmp(argv[i], "-D") == 0)
{
delete_all();
delete_all(ac);
no_files = 0;
continue;
}
no_files = 0;
if (deleting)
delete_file(av[i]);
delete_file(ac, argv[i]);
else
add_file(av[i]);
add_file(ac, argv[i]);
}
if (no_files)
{
@@ -242,13 +204,15 @@ main(int ac, char **av)
if (!pw)
{
fprintf(stderr, "No user found with uid %d\n", (int)getuid());
ssh_close_authentication_connection(ac);
exit(1);
}
snprintf(buf, sizeof buf, "%s/%s", pw->pw_dir, SSH_CLIENT_IDENTITY);
if (deleting)
delete_file(buf);
delete_file(ac, buf);
else
add_file(buf);
add_file(ac, buf);
}
ssh_close_authentication_connection(ac);
exit(0);
}
+50 -11
View File
@@ -1,16 +1,16 @@
.\" $OpenBSD: ssh-agent.1,v 1.7 1999/10/28 08:43:10 markus Exp $
.\"
.\" -*- nroff -*-
.\"
.\" ssh-agent.1
.\"
.\" Author: Tatu Ylonen <[email protected]>
.\"
pp.\"
.\" Copyright (c) 1995 Tatu Ylonen <[email protected]>, Espoo, Finland
.\" All rights reserved
.\"
.\" Created: Sat Apr 23 20:10:43 1995 ylo
.\"
.\" $Id: ssh-agent.1,v 1.1 1999/10/27 03:42:45 damien Exp $
.\"
.Dd September 25, 1999
.Dt SSH-AGENT 1
.Os
@@ -19,22 +19,47 @@
.Nd authentication agent
.Sh SYNOPSIS
.Nm ssh-agent
.Op Fl c Li | Fl s
.Op Fl k
.Oo
.Ar command
.Op Ar args ...
.Oc
.Sh DESCRIPTION
.Nm
is a program to hold authentication private keys. The
idea is that
.Nm
is started in the beginning of an X-session or a login session, and
all other windows or programs are started as children of the ssh-agent
program (the
.Ar command
normally starts X or is the user shell). Programs started under
the agent inherit a connection to the agent, and the agent is
automatically used for RSA authentication when logging to other
all other windows or programs are started as clients to the ssh-agent
program. Through use of environment variables the agent can be located
and automatically used for RSA authentication when logging in to other
machines using
.Xr ssh 1 .
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl c
Generate C-shell commands on
.Dv stdout .
This is the default if
.Ev SHELL
looks like it's a csh style of shell.
.It Fl s
Generate Bourne shell commands on
.Dv stdout .
This is the default if
.Ev SHELL
does not look like it's a csh style of shell.
.It Fl k
Kill the current agent (given by the
.Ev SSH_AGENT_PID
environment variable).
.El
.Pp
If a commandline is given, this is executed as a subprocess of the agent.
When the command dies, so does the agent.
.Pp
The agent initially does not have any private keys. Keys are added
using
.Xr ssh-add 1 .
@@ -58,9 +83,19 @@ However, the connection to the agent is forwarded over SSH
remote logins, and the user can thus use the privileges given by the
identities anywhere in the network in a secure way.
.Pp
A connection to the agent is inherited by child programs:
There are two main ways to get an agent setup: Either you let the agent
start a new subcommand into which some environment variables are exported, or
you let the agent print the needed shell commands (either
.Xr sh 1
or
.Xr csh 1
syntax can be generated) which can be evalled in the calling shell.
Later
.Xr ssh 1
look at these variables and use them to establish a connection to the agent.
.Pp
A unix-domain socket is created
.Pq Pa /tmp/ssh-XXXX/agent.<pid> ,
.Pq Pa /tmp/ssh-XXXXXXXX/agent.<pid> ,
and the name of this socket is stored in the
.Ev SSH_AUTH_SOCK
environment
@@ -68,6 +103,10 @@ variable. The socket is made accessible only to the current user.
This method is easily abused by root or another instance of the same
user.
.Pp
The
.Ev SSH_AGENT_PID
environment variable holds the agent's PID.
.Pp
The agent exits automatically when the command given on the command
line terminates.
.Sh FILES
+150 -29
View File
@@ -1,3 +1,5 @@
/* $OpenBSD: ssh-agent.c,v 1.16 1999/10/28 20:41:23 markus Exp $ */
/*
ssh-agent.c
@@ -14,7 +16,7 @@ The authentication agent program.
*/
#include "includes.h"
RCSID("$Id: ssh-agent.c,v 1.1 1999/10/27 03:42:45 damien Exp $");
RCSID("$OpenBSD: ssh-agent.c,v 1.16 1999/10/28 20:41:23 markus Exp $");
#include "ssh.h"
#include "rsa.h"
@@ -26,7 +28,12 @@ RCSID("$Id: ssh-agent.c,v 1.1 1999/10/27 03:42:45 damien Exp $");
#include "getput.h"
#include "mpaux.h"
#ifdef HAVE_OPENSSL
#include <openssl/md5.h>
#endif
#ifdef HAVE_SSL
#include <ssl/md5.h>
#endif
typedef struct
{
@@ -476,17 +483,39 @@ check_parent_exists(int sig)
alarm(10);
}
void cleanup_socket(void) {
void
cleanup_socket(void)
{
remove(socket_name);
rmdir(socket_dir);
}
void
cleanup_exit(int i)
{
cleanup_socket();
exit(i);
}
void
usage()
{
extern char *__progname;
fprintf(stderr, "ssh-agent version %s\n", SSH_VERSION);
fprintf(stderr, "Usage: %s [-c | -s] [-k] [command {args...]]\n",
__progname);
exit(1);
}
int
main(int ac, char **av)
{
fd_set readset, writeset;
int sock;
int sock, c_flag = 0, k_flag = 0, s_flag = 0, ch;
struct sockaddr_un sunaddr;
pid_t pid;
char *shell, *format, *pidstr, pidstrbuf[1 + 3 * sizeof pid];
/* check if RSA support exists */
if (rsa_alive() == 0) {
@@ -497,11 +526,66 @@ main(int ac, char **av)
exit(1);
}
if (ac < 2)
while ((ch = getopt(ac, av, "cks")) != -1)
{
fprintf(stderr, "ssh-agent version %s\n", SSH_VERSION);
fprintf(stderr, "Usage: %s command\n", av[0]);
exit(1);
switch (ch)
{
case 'c':
if (s_flag)
usage();
c_flag++;
break;
case 'k':
k_flag++;
break;
case 's':
if (c_flag)
usage();
s_flag++;
break;
default:
usage();
}
}
ac -= optind;
av += optind;
if (ac > 0 && (c_flag || k_flag || s_flag))
usage();
if (ac == 0 && !c_flag && !k_flag && !s_flag)
{
shell = getenv("SHELL");
if (shell != NULL && strncmp(shell + strlen(shell) - 3, "csh", 3) == 0)
c_flag = 1;
}
if (k_flag)
{
pidstr = getenv(SSH_AGENTPID_ENV_NAME);
if (pidstr == NULL)
{
fprintf(stderr, "%s not set, cannot kill agent\n",
SSH_AGENTPID_ENV_NAME);
exit(1);
}
pid = atoi(pidstr);
if (pid < 1) /* XXX PID_MAX check too */
{
fprintf(stderr, "%s=\"%s\", which is not a good PID\n",
SSH_AGENTPID_ENV_NAME, pidstr);
exit(1);
}
if (kill(pid, SIGTERM) == -1)
{
perror("kill");
exit(1);
}
format = c_flag ? "unsetenv %s;\n" : "unset %s;\n";
printf(format, SSH_AUTHSOCKET_ENV_NAME);
printf(format, SSH_AGENTPID_ENV_NAME);
printf("echo Agent pid %d killed;\n", pid);
exit(0);
}
parent_pid = getpid();
@@ -512,29 +596,16 @@ main(int ac, char **av)
perror("mkdtemp: private socket dir");
exit(1);
}
snprintf(socket_name, sizeof socket_name, "%s/agent.%d", socket_dir, parent_pid);
/* Fork, and have the parent execute the command. The child continues as
the authentication agent. */
if (fork() != 0)
{ /* Parent - execute the given command. */
setenv(SSH_AUTHSOCKET_ENV_NAME, socket_name, 1);
execvp(av[1], av + 1);
perror(av[1]);
exit(1);
}
if (atexit(cleanup_socket) < 0) {
perror("atexit");
cleanup_socket();
exit(1);
}
snprintf(socket_name, sizeof socket_name, "%s/agent.%d", socket_dir,
parent_pid);
/* Create socket early so it will exist before command gets run from
the parent. */
sock = socket(AF_UNIX, SOCK_STREAM, 0);
if (sock < 0)
{
perror("socket");
exit(1);
cleanup_exit(1);
}
memset(&sunaddr, 0, sizeof(sunaddr));
sunaddr.sun_family = AF_UNIX;
@@ -542,18 +613,69 @@ main(int ac, char **av)
if (bind(sock, (struct sockaddr *)&sunaddr, sizeof(sunaddr)) < 0)
{
perror("bind");
exit(1);
cleanup_exit(1);
}
if (listen(sock, 5) < 0)
{
perror("listen");
cleanup_exit(1);
}
/* Fork, and have the parent execute the command, if any, or present the
socket data. The child continues as the authentication agent. */
pid = fork();
if (pid == -1)
{
perror("fork");
exit(1);
}
if (pid != 0)
{ /* Parent - execute the given command. */
close(sock);
snprintf(pidstrbuf, sizeof pidstrbuf, "%d", pid);
if (ac == 0)
{
format = c_flag ? "setenv %s %s;\n" : "%s=%s; export %s;\n";
printf(format, SSH_AUTHSOCKET_ENV_NAME, socket_name,
SSH_AUTHSOCKET_ENV_NAME);
printf(format, SSH_AGENTPID_ENV_NAME, pidstrbuf,
SSH_AGENTPID_ENV_NAME);
printf("echo Agent pid %d;\n", pid);
exit(0);
}
setenv(SSH_AUTHSOCKET_ENV_NAME, socket_name, 1);
setenv(SSH_AGENTPID_ENV_NAME, pidstrbuf, 1);
execvp(av[0], av);
perror(av[0]);
exit(1);
}
close(0);
close(1);
close(2);
if (setsid() == -1)
{
perror("setsid");
cleanup_exit(1);
}
if (atexit(cleanup_socket) < 0)
{
perror("atexit");
cleanup_exit(1);
}
new_socket(AUTH_SOCKET, sock);
signal(SIGALRM, check_parent_exists);
alarm(10);
if (ac > 0)
{
signal(SIGALRM, check_parent_exists);
alarm(10);
}
signal(SIGINT, SIG_IGN);
signal(SIGPIPE, SIG_IGN);
while (1)
{
FD_ZERO(&readset);
@@ -563,7 +685,6 @@ main(int ac, char **av)
{
if (errno == EINTR)
continue;
perror("select");
exit(1);
}
after_select(&readset, &writeset);
+1 -1
View File
@@ -9,7 +9,7 @@
.\"
.\" Created: Sat Apr 22 23:55:14 1995 ylo
.\"
.\" $Id: ssh-keygen.1,v 1.1 1999/10/27 03:42:45 damien Exp $
.\" $Id: ssh-keygen.1,v 1.3 1999/10/28 23:15:49 damien Exp $
.\"
.Dd September 25, 1999
.Dt SSH-KEYGEN 1
+14 -14
View File
@@ -9,7 +9,7 @@
.\"
.\" Created: Sat Apr 22 21:55:14 1995 ylo
.\"
.\" $Id: ssh.1,v 1.1 1999/10/27 03:42:45 damien Exp $
.\" $Id: ssh.1,v 1.4 1999/10/28 23:17:36 damien Exp $
.\"
.Dd September 25, 1999
.Dt SSH 1
@@ -66,7 +66,7 @@ his/her identity to the remote machine using one of several methods.
First, if the machine the user logs in from is listed in
.Pa /etc/hosts.equiv
or
.Pa /etc/shosts.equiv
.Pa /etc/ssh/shosts.equiv
on the remote machine, and the user names are
the same on both sides, the user is immediately permitted to log in.
Second, if
@@ -89,10 +89,10 @@ means that if the login would be permitted by
.Pa \&.shosts ,
.Pa /etc/hosts.equiv ,
or
.Pa /etc/shosts.equiv ,
.Pa /etc/ssh/shosts.equiv ,
and if additionally the server can verify the client's
host key (see
.Pa /etc/ssh_known_hosts
.Pa /etc/ssh/ssh_known_hosts
in the
.Sx FILES
section), only then login is
@@ -248,7 +248,7 @@ identifications for all hosts it has ever been used with. The
database is stored in
.Pa \&.ssh/known_hosts
in the user's home directory. Additionally, the file
.Pa /etc/ssh_known_hosts
.Pa /etc/ssh/ssh_known_hosts
is automatically checked for known hosts. Any new hosts are
automatically added to the user's file. If a host's identification
ever changes,
@@ -416,7 +416,7 @@ obtains configuration data from the following sources (in this order):
command line options, user's configuration file
.Pq Pa $HOME/.ssh/config ,
and system-wide configuration file
.Pq Pa /etc/ssh_config .
.Pq Pa /etc/ssh/ssh_config .
For each parameter, the first obtained value
will be used. The configuration files contain sections bracketed by
"Host" specifications, and that section is only applied for hosts that
@@ -540,7 +540,7 @@ The default is
.Dq no .
.It Cm GlobalKnownHostsFile
Specifies a file to use instead of
.Pa /etc/ssh_known_hosts .
.Pa /etc/ssh/ssh_known_hosts .
.It Cm HostName
Specifies the real host name to log into. This can be used to specify
nicnames or abbreviations for hosts. Default is the name given on the
@@ -672,7 +672,7 @@ ssh will never automatically add host keys to the
file, and refuses to connect hosts whose host key has changed. This
provides maximum protection against trojan horse attacks. However, it
can be somewhat annoying if you don't have good
.Pa /etc/ssh_known_hosts
.Pa /etc/ssh/ssh_known_hosts
files installed and frequently
connect new hosts. Basically this option forces the user to manually
add any new hosts. Normally this option is disabled, and new hosts
@@ -779,7 +779,7 @@ to the environment.
.It Pa $HOME/.ssh/known_hosts
Records host keys for all hosts the user has logged into (that are not
in
.Pa /etc/ssh_known_hosts ) .
.Pa /etc/ssh/ssh_known_hosts ) .
See
.Xr sshd 8 .
.It Pa $HOME/.ssh/random_seed
@@ -824,7 +824,7 @@ identity files (that is, each line contains the number of bits in
modulus, public exponent, modulus, and comment fields, separated by
spaces). This file is not highly sensitive, but the recommended
permissions are read/write for the user, and not accessible by others.
.It Pa /etc/ssh_known_hosts
.It Pa /etc/ssh/ssh_known_hosts
Systemwide list of known host keys. This file should be prepared by the
system administrator to contain the public host keys of all machines in the
organization. This file should be world-readable. This file contains
@@ -843,7 +843,7 @@ to verify the client host when logging in; other names are needed because
does not convert the user-supplied name to a canonical name before
checking the key, because someone with access to the name servers
would then be able to fool host authentication.
.It Pa /etc/ssh_config
.It Pa /etc/ssh/ssh_config
Systemwide configuration file. This file provides defaults for those
values that are not specified in the user's configuration file, and
for those users who do not have a configuration file. This file must
@@ -870,7 +870,7 @@ Note that by default
will be installed so that it requires successful RSA host
authentication before permitting \s+2.\s0rhosts authentication. If your
server machine does not have the client's host key in
.Pa /etc/ssh_known_hosts ,
.Pa /etc/ssh/ssh_known_hosts ,
you can store it in
.Pa $HOME/.ssh/known_hosts .
The easiest way to do this is to
@@ -897,13 +897,13 @@ manual page). If the client host is found in this file, login is
automatically permitted provided client and server user names are the
same. Additionally, successful RSA host authentication is normally
required. This file should only be writable by root.
.It Pa /etc/shosts.equiv
.It Pa /etc/ssh/shosts.equiv
This file is processed exactly as
.Pa /etc/hosts.equiv .
This file may be useful to permit logins using
.Nm
but not using rsh/rlogin.
.It Pa /etc/sshrc
.It Pa /etc/ssh/sshrc
Commands in this file are executed by
.Nm
when the user logs in just before the user's shell (or command) is started.
+3 -11
View File
@@ -18,7 +18,7 @@ Modified to work with SSL by Niels Provos <[email protected]> in Canada.
*/
#include "includes.h"
RCSID("$Id: ssh.c,v 1.1 1999/10/27 03:42:45 damien Exp $");
RCSID("$Id: ssh.c,v 1.4 1999/10/30 01:39:56 damien Exp $");
#include "xmalloc.h"
#include "ssh.h"
@@ -158,8 +158,6 @@ rsh_connect(char *host, char *user, Buffer *command)
/* Main program for the ssh client. */
uid_t original_real_uid;
int
main(int ac, char **av)
{
@@ -501,7 +499,7 @@ main(int ac, char **av)
}
/* Disable rhosts authentication if not running as root. */
if (original_effective_uid != 0)
if (original_effective_uid != 0 || !options.use_privileged_port)
{
options.rhosts_authentication = 0;
options.rhosts_rsa_authentication = 0;
@@ -527,13 +525,7 @@ main(int ac, char **av)
restore_uid();
/* Open a connection to the remote host. This needs root privileges if
rhosts_{rsa_}authentication is true. */
if (!options.use_privileged_port)
{
options.rhosts_authentication = 0;
options.rhosts_rsa_authentication = 0;
}
rhosts_{rsa_}authentication is enabled. */
ok = ssh_connect(host, &hostaddr, options.port, options.connection_attempts,
!options.rhosts_authentication &&
+19 -1
View File
@@ -13,11 +13,25 @@ Generic header file for ssh.
*/
/* RCSID("$Id: ssh.h,v 1.1 1999/10/27 03:42:45 damien Exp $"); */
/* RCSID("$Id: ssh.h,v 1.5 1999/10/29 00:21:15 damien Exp $"); */
#ifndef SSH_H
#define SSH_H
/* Added by Dan */
#ifndef SHUT_RDWR
enum
{
SHUT_RD = 0, /* No more receptions. */
#define SHUT_RD SHUT_RD
SHUT_WR, /* No more transmissions. */
#define SHUT_WR SHUT_WR
SHUT_RDWR /* No more receptions or transmissions. */
#define SHUT_RDWR SHUT_RDWR
};
#endif
#include "rsa.h"
#include "cipher.h"
@@ -123,6 +137,10 @@ only by root, whereas ssh_config should be world-readable. */
authentication socket. */
#define SSH_AUTHSOCKET_ENV_NAME "SSH_AUTH_SOCK"
/* Name of the environment variable containing the pathname of the
authentication socket. */
#define SSH_AGENTPID_ENV_NAME "SSH_AGENT_PID"
/* Force host key length and server key length to differ by at least this
many bits. This is to make double encryption with rsaref work. */
#define SSH_KEY_BITS_RESERVED 128
+10 -2
View File
@@ -14,10 +14,19 @@ login (authentication) dialog.
*/
#include "config.h"
#include "includes.h"
RCSID("$Id: sshconnect.c,v 1.1 1999/10/27 03:42:45 damien Exp $");
RCSID("$Id: sshconnect.c,v 1.3 1999/10/28 05:23:30 damien Exp $");
#ifdef HAVE_OPENSSL
#include <openssl/bn.h>
#include <openssl/md5.h>
#endif
#ifdef HAVE_SSL
#include <ssl/bn.h>
#include <ssl/md5.h>
#endif
#include "xmalloc.h"
#include "rsa.h"
#include "ssh.h"
@@ -28,7 +37,6 @@ RCSID("$Id: sshconnect.c,v 1.1 1999/10/27 03:42:45 damien Exp $");
#include "uidswap.h"
#include "compat.h"
#include <openssl/md5.h>
/* Session id for the current session. */
unsigned char session_id[16];
+19 -19
View File
@@ -9,7 +9,7 @@
.\"
.\" Created: Sat Apr 22 21:55:14 1995 ylo
.\"
.\" $Id: sshd.8,v 1.1 1999/10/27 03:42:46 damien Exp $
.\" $Id: sshd.8,v 1.4 1999/10/28 23:17:36 damien Exp $
.\"
.Dd September 25, 1999
.Dt SSHD 8
@@ -118,7 +118,7 @@ not fork and will only process one connection. This option is only
intended for debugging for the server.
.It Fl f Ar configuration_file
Specifies the name of the configuration file. The default is
.Pa /etc/sshd_config .
.Pa /etc/ssh/sshd_config .
.Nm
refuses to start if there is no configuration file.
.It Fl g Ar login_grace_time
@@ -128,7 +128,7 @@ this many seconds, the server disconnects and exits. A value of zero
indicates no limit.
.It Fl h Ar host_key_file
Specifies the file from which the host key is read (default
.Pa /etc/ssh_host_key ) .
.Pa /etc/ssh/ssh_host_key ) .
This option must be given if
.Nm
is not run as root (as the normal
@@ -165,7 +165,7 @@ Do not print an error message if RSA support is missing.
.Sh CONFIGURATION FILE
.Nm
reads configuration data from
.Pa /etc/sshd_config
.Pa /etc/ssh/sshd_config
(or the file specified with
.Fl f
on the command line). The file
@@ -242,7 +242,7 @@ The default is
.Dq no .
.It Cm HostKey
Specifies the file containing the private host key (default
.Pa /etc/ssh_host_key ) .
.Pa /etc/ssh/ssh_host_key ) .
Note that
.Nm
does not start if this file is group/world-accessible.
@@ -251,7 +251,7 @@ Specifies that rhosts and shosts files will not be used in
authentication.
.Pa /etc/hosts.equiv
and
.Pa /etc/shosts.equiv
.Pa /etc/ssh/shosts.equiv
are still used. The default is
.Dq no .
.It Cm KeepAlive
@@ -455,7 +455,7 @@ Changes to user's home directory.
If
.Pa $HOME/.ssh/rc
exists, runs it; else if
.Pa /etc/sshrc
.Pa /etc/ssh/sshrc
exists, runs
it; otherwise runs xauth. The
.Dq rc
@@ -541,7 +541,7 @@ from="*.niksula.hut.fi,!pc.niksula.hut.fi" 1024 35 23.\|.\|.\|2334 ylo@niksula
command="dump /home",no-pty,no-port-forwarding 1024 33 23.\|.\|.\|2323 backup.hut.fi
.Sh SSH_KNOWN_HOSTS FILE FORMAT
The
.Pa /etc/ssh_known_hosts
.Pa /etc/ssh/ssh_known_hosts
and
.Pa $HOME/.ssh/known_hosts
files contain host public keys for all known hosts. The global file should
@@ -564,7 +564,7 @@ pattern on the line.
.Pp
Bits, exponent, and modulus are taken directly from the host key; they
can be obtained, e.g., from
.Pa /etc/ssh_host_key.pub .
.Pa /etc/ssh/ssh_host_key.pub .
The optional comment field continues to the end of the line, and is not used.
.Pp
Lines starting with
@@ -583,25 +583,25 @@ Note that the lines in these files are typically hundreds of characters
long, and you definitely don't want to type in the host keys by hand.
Rather, generate them by a script
or by taking
.Pa /etc/ssh_host_key.pub
.Pa /etc/ssh/ssh_host_key.pub
and adding the host names at the front.
.Ss Examples
closenet,closenet.hut.fi,.\|.\|.\|,130.233.208.41 1024 37 159.\|.\|.93 closenet.hut.fi
.Sh FILES
.Bl -tag -width Ds
.It Pa /etc/sshd_config
.It Pa /etc/ssh/sshd_config
Contains configuration data for
.Nm sshd .
This file should be writable by root only, but it is recommended
(though not necessary) that it be world-readable.
.It Pa /etc/ssh_host_key
.It Pa /etc/ssh/ssh_host_key
Contains the private part of the host key.
This file should only be owned by root, readable only by root, and not
accessible to others.
Note that
.Nm
does not start if this file is group/world-accessible.
.It Pa /etc/ssh_host_key.pub
.It Pa /etc/ssh/ssh_host_key.pub
Contains the public part of the host key.
This file should be world-readable but writable only by
root. Its contents should match the private part. This file is not
@@ -622,17 +622,17 @@ This file must be readable by root (which may on some machines imply
it being world-readable if the user's home directory resides on an NFS
volume). It is recommended that it not be accessible by others. The
format of this file is described above.
.It Pa /etc/ssh_known_hosts
.It Pa /etc/ssh/ssh_known_hosts
This file is consulted when using rhosts with RSA host
authentication to check the public key of the host. The key must be
listed in this file to be accepted.
.It Pa $HOME/.ssh/known_hosts
The client uses this file
and
.Pa /etc/ssh_known_hosts
.Pa /etc/ssh/ssh_known_hosts
to verify that the remote host is the one we intended to
connect. These files should be writable only by root/the owner.
.Pa /etc/ssh_known_hosts
.Pa /etc/ssh/ssh_known_hosts
should be world-readable, and
.Pa $HOME/.ssh/known_hosts
can but need not be world-readable.
@@ -694,7 +694,7 @@ user root access. The only valid use for user names that I can think
of is in negative entries.
.Pp
Note that this warning also applies to rsh/rlogin.
.It Pa /etc/shosts.equiv
.It Pa /etc/ssh/shosts.equiv
This is processed exactly as
.Pa /etc/hosts.equiv .
However, this file may be useful in environments that want to run both
@@ -724,13 +724,13 @@ something similar to: "if read proto cookie; then echo add $DISPLAY
$proto $cookie | xauth -q -; fi".
.Pp
If this file does not exist,
.Pa /etc/sshrc
.Pa /etc/ssh/sshrc
is run, and if that
does not exist either, xauth is used to store the cookie.
.Pp
This file should be writable only by the user, and need not be
readable by anyone else.
.It Pa /etc/sshrc
.It Pa /etc/ssh/sshrc
Like
.Pa $HOME/.ssh/rc .
This can be used to specify
+103 -52
View File
@@ -18,7 +18,7 @@ agent connections.
*/
#include "includes.h"
RCSID("$Id: sshd.c,v 1.3 1999/10/28 03:20:30 damien Exp $");
RCSID("$Id: sshd.c,v 1.9 1999/10/29 03:09:40 damien Exp $");
#include "xmalloc.h"
#include "rsa.h"
@@ -129,7 +129,7 @@ void do_exec_no_pty(const char *command, struct passwd *pw,
void do_child(const char *command, struct passwd *pw, const char *term,
const char *display, const char *auth_proto,
const char *auth_data, const char *ttyname);
#ifdef HAVE_PAM
#ifdef HAVE_LIBPAM
static int pamconv(int num_msg, const struct pam_message **msg,
struct pam_response **resp, void *appdata_ptr);
void do_pam_account_and_session(const char *username, const char *password,
@@ -188,44 +188,67 @@ static int pamconv(int num_msg, const struct pam_message **msg,
void pam_cleanup_proc(void *context)
{
int retval;
int pam_retval;
if (pamh != NULL)
{
retval = pam_close_session((pam_handle_t *)pamh, 0);
if (pam_end((pam_handle_t *)pamh, retval) != PAM_SUCCESS)
log("Cannot release PAM authentication.");
pam_retval = pam_close_session((pam_handle_t *)pamh, 0);
if (pam_retval != PAM_SUCCESS)
{
log("Cannot close PAM session: %.200s",
pam_strerror((pam_handle_t *)pamh, pam_retval));
}
pam_retval = pam_end((pam_handle_t *)pamh, pam_retval);
if (pam_retval != PAM_SUCCESS)
{
log("Cannot release PAM authentication: %.200s",
pam_strerror((pam_handle_t *)pamh, pam_retval));
}
}
}
void do_pam_account_and_session(const char *username, const char *password, const char *remote_user, const char *remote_host)
{
if (remote_host && (PAM_SUCCESS != pam_set_item((pam_handle_t *)pamh, PAM_RHOST, remote_host)))
int pam_retval;
if (remote_host != NULL)
{
log("PAM setup failed.");
debug("PAM setting rhost to \"%.200s\"", remote_host);
pam_retval = pam_set_item((pam_handle_t *)pamh, PAM_RHOST, remote_host);
if (pam_retval != PAM_SUCCESS)
{
log("PAM set rhost failed: %.200s", pam_strerror((pam_handle_t *)pamh, pam_retval));
eat_packets_and_disconnect(username);
}
}
if (remote_user != NULL)
{
debug("PAM setting ruser to \"%.200s\"", remote_user);
pam_retval = pam_set_item((pam_handle_t *)pamh, PAM_RUSER, remote_user);
if (pam_retval != PAM_SUCCESS)
{
log("PAM set ruser failed: %.200s", pam_strerror((pam_handle_t *)pamh, pam_retval));
eat_packets_and_disconnect(username);
}
}
pam_retval = pam_acct_mgmt((pam_handle_t *)pamh, 0);
if (pam_retval != PAM_SUCCESS)
{
log("PAM rejected by account configuration: %.200s", pam_strerror((pam_handle_t *)pamh, pam_retval));
eat_packets_and_disconnect(username);
}
if (remote_user && (PAM_SUCCESS != pam_set_item((pam_handle_t *)pamh, PAM_RUSER, remote_user)))
pam_retval = pam_open_session((pam_handle_t *)pamh, 0);
if (pam_retval != PAM_SUCCESS)
{
log("PAM setup failed.");
eat_packets_and_disconnect(username);
}
if (PAM_SUCCESS != pam_acct_mgmt((pam_handle_t *)pamh, 0))
{
log("PAM rejected by account configuration.");
eat_packets_and_disconnect(username);
}
if (PAM_SUCCESS != pam_open_session((pam_handle_t *)pamh, 0))
{
log("PAM session setup failed.");
log("PAM session setup failed: %.200s", pam_strerror((pam_handle_t *)pamh, pam_retval));
eat_packets_and_disconnect(username);
}
}
#endif /* HAVE_PAM */
#endif /* HAVE_LIBPAM */
/* Signal handler for SIGHUP. Sshd execs itself when it receives SIGHUP;
the effect is to reread the configuration file (and to regenerate
@@ -809,21 +832,23 @@ main(int ac, char **av)
/* The connection has been terminated. */
log("Closing connection to %.100s", inet_ntoa(sin.sin_addr));
#ifdef HAVE_PAM
#ifdef HAVE_LIBPAM
{
int retval;
if (pamh != NULL)
{
debug("Closing PAM session.");
retval = pam_close_session((pam_handle_t *)pamh, 0);
debug("Terminating PAM library.");
if (pam_end((pam_handle_t *)pamh, retval) != PAM_SUCCESS)
log("Cannot release PAM authentication.");
fatal_remove_cleanup(&pam_cleanup_proc, NULL);
}
}
#endif /* HAVE_PAM */
#endif /* HAVE_LIBPAM */
packet_close();
@@ -1111,7 +1136,10 @@ do_authentication(char *user, int privileged_port)
char *client_user = NULL;
unsigned int client_host_key_bits;
BIGNUM *client_host_key_e, *client_host_key_n;
#ifdef HAVE_LIBPAM
int pam_retval;
#endif /* HAVE_LIBPAM */
#ifdef AFS
/* If machine has AFS, set process authentication group. */
if (k_hasafs()) {
@@ -1135,18 +1163,17 @@ do_authentication(char *user, int privileged_port)
pwcopy.pw_shell = xstrdup(pw->pw_shell);
pw = &pwcopy;
#ifdef HAVE_PAM
if (PAM_SUCCESS != pam_start("ssh", pw->pw_name, &conv, (pam_handle_t**)&pamh))
#ifdef HAVE_LIBPAM
debug("Starting up PAM with username \"%.200s\"", pw->pw_name);
pam_retval = pam_start("sshd", pw->pw_name, &conv, (pam_handle_t**)&pamh);
if (pam_retval != PAM_SUCCESS)
{
packet_start(SSH_SMSG_FAILURE);
packet_send();
packet_write_wait();
packet_disconnect("PAM initialisation failed.");
log("PAM initialisation failed: %.200s", pam_strerror((pam_handle_t *)pamh, pam_retval));
eat_packets_and_disconnect(user);
}
fatal_add_cleanup(&pam_cleanup_proc, NULL);
#endif
fatal_add_cleanup(&pam_cleanup_proc, NULL);
/* If we are not running as root, the user must have the same uid as the
server. */
if (getuid() != 0 && pw->pw_uid != getuid())
@@ -1289,16 +1316,16 @@ do_authentication(char *user, int privileged_port)
log("Rhosts authentication accepted for %.100s, remote %.100s on %.700s.",
user, client_user, get_canonical_hostname());
authenticated = 1;
#ifndef HAVE_PAM
#ifndef HAVE_LIBPAM
xfree(client_user);
#endif /* HAVE_PAM */
#endif /* HAVE_LIBPAM */
break;
}
log("Rhosts authentication failed for %.100s, remote %.100s.",
user, client_user);
#ifndef HAVE_PAM
#ifndef HAVE_LIBPAM
xfree(client_user);
#endif /* HAVE_PAM */
#endif /* HAVE_LIBPAM */
break;
case SSH_CMSG_AUTH_RHOSTS_RSA:
@@ -1341,18 +1368,18 @@ do_authentication(char *user, int privileged_port)
{
/* Authentication accepted. */
authenticated = 1;
#ifndef HAVE_PAM
#ifndef HAVE_LIBPAM
xfree(client_user);
#endif /* HAVE_PAM */
#endif /* HAVE_LIBPAM */
BN_clear_free(client_host_key_e);
BN_clear_free(client_host_key_n);
break;
}
log("Rhosts authentication failed for %.100s, remote %.100s.",
user, client_user);
#ifndef HAVE_PAM
#ifndef HAVE_LIBPAM
xfree(client_user);
#endif /* HAVE_PAM */
#endif /* HAVE_LIBPAM */
BN_clear_free(client_host_key_e);
BN_clear_free(client_host_key_n);
break;
@@ -1403,20 +1430,22 @@ do_authentication(char *user, int privileged_port)
packet_integrity_check(plen, 4 + passw_len, type);
}
#ifdef HAVE_PAM
#ifdef HAVE_LIBPAM
pampasswd = password;
if (PAM_SUCCESS == pam_authenticate((pam_handle_t *)pamh, 0))
pam_retval = pam_authenticate((pam_handle_t *)pamh, 0);
if (pam_retval == PAM_SUCCESS)
{
log("PAM Password authentication accepted for %.100s.", user);
log("PAM Password authentication accepted for \"%.100s\"", user);
authenticated = 1;
break;
} else
{
log("PAM Password authentication for %.100s failed.", user);
log("PAM Password authentication for \"%.100s\" failed: %s",
user, pam_strerror((pam_handle_t *)pamh, pam_retval));
break;
}
#else /* HAVE_PAM */
#else /* HAVE_LIBPAM */
/* Try authentication with the password. */
if (auth_password(pw, password))
{
@@ -1432,7 +1461,7 @@ do_authentication(char *user, int privileged_port)
memset(password, 0, strlen(password));
xfree(password);
break;
#endif /* HAVE_PAM */
#endif /* HAVE_LIBPAM */
case SSH_CMSG_AUTH_TIS:
/* TIS Authentication is unsupported */
@@ -1470,7 +1499,7 @@ do_authentication(char *user, int privileged_port)
get_canonical_hostname());
}
#ifdef HAVE_PAM
#ifdef HAVE_LIBPAM
do_pam_account_and_session(pw->pw_name, password, client_user, get_canonical_hostname());
/* Clean up */
@@ -1482,7 +1511,7 @@ do_authentication(char *user, int privileged_port)
memset(password, 0, strlen(password));
xfree(password);
}
#endif /* HAVE_PAM */
#endif /* HAVE_LIBPAM */
/* The user has been authenticated and accepted. */
packet_start(SSH_SMSG_SUCCESS);
@@ -2328,6 +2357,28 @@ void do_child(const char *command, struct passwd *pw, const char *term,
child_set_env(&env, &envsize, "KRBTKFILE", ticket);
#endif /* KRB4 */
#ifdef HAVE_LIBPAM
/* Pull in any environment variables that may have been set by PAM. */
{
char *equal_sign, var_name[256], var_val[256];
long this_var;
char **pam_env = pam_getenvlist((pam_handle_t *)pamh);
for(this_var = 0; pam_env && pam_env[this_var]; this_var++)
{
if(strlen(pam_env[this_var]) < (sizeof(var_name) - 1))
if((equal_sign = strstr(pam_env[this_var], "=")) != NULL)
{
memset(var_name, 0, sizeof(var_name));
memset(var_val, 0, sizeof(var_val));
strncpy(var_name, pam_env[this_var],
equal_sign - pam_env[this_var]);
strcpy(var_val, equal_sign + 1);
child_set_env(&env, &envsize, var_name, var_val);
}
}
}
#endif /* HAVE_LIBPAM */
/* Set XAUTHORITY to always be a local file. */
if (xauthfile)
child_set_env(&env, &envsize, "XAUTHORITY", xauthfile);
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/bash
# Init file for OpenSSH sshd
# Init file for OpenSSH server daemon
#
# chkconfig: 2345 55 25
# description: OpenSSH server daemon
View File
+5
View File
@@ -34,6 +34,9 @@ static char *rcsid = "$OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp
#include <sys/types.h>
#include <string.h>
#include "config.h"
#ifndef HAVE_STRLCPY
/*
* Copy src to string dst of size siz. At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).
@@ -66,3 +69,5 @@ size_t strlcpy(dst, src, siz)
return(s - src - 1); /* count does not include NUL */
}
#endif /* !HAVE_STRLCPY */
+5
View File
@@ -1,4 +1,9 @@
#ifndef _STRLCPY_H
#define _STRLCPY_H
#include "config.h"
#ifndef HAVE_STRLCPY
size_t strlcpy(char *dst, const char *src, size_t siz);
#endif /* !HAVE_STRLCPY */
#endif /* _STRLCPY_H */