- stevesk@cvs.openbsd.org 2001/03/25 13:16:11
[servconf.c servconf.h session.c sshd.8 sshd_config] PrintLastLog option; from chip@valinux.com with some minor changes by me. ok markus@
This commit is contained in:
parent
6029432ec5
commit
7bfff36ca3
|
@ -6,6 +6,10 @@
|
||||||
- djm@cvs.openbsd.org 2001/03/25 00:01:34
|
- djm@cvs.openbsd.org 2001/03/25 00:01:34
|
||||||
[session.c]
|
[session.c]
|
||||||
shorten; ok markus@
|
shorten; ok markus@
|
||||||
|
- stevesk@cvs.openbsd.org 2001/03/25 13:16:11
|
||||||
|
[servconf.c servconf.h session.c sshd.8 sshd_config]
|
||||||
|
PrintLastLog option; from chip@valinux.com with some minor
|
||||||
|
changes by me. ok markus@
|
||||||
|
|
||||||
20010324
|
20010324
|
||||||
- Fixed permissions ssh-keyscan. Thanks to Christopher Linn <celinn@mtu.edu>.
|
- Fixed permissions ssh-keyscan. Thanks to Christopher Linn <celinn@mtu.edu>.
|
||||||
|
@ -4714,4 +4718,4 @@
|
||||||
- Wrote replacements for strlcpy and mkdtemp
|
- Wrote replacements for strlcpy and mkdtemp
|
||||||
- Released 1.0pre1
|
- Released 1.0pre1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.1018 2001/03/26 05:38:25 mouring Exp $
|
$Id: ChangeLog,v 1.1019 2001/03/26 05:45:53 mouring Exp $
|
||||||
|
|
13
servconf.c
13
servconf.c
|
@ -10,7 +10,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: servconf.c,v 1.71 2001/03/05 15:44:51 stevesk Exp $");
|
RCSID("$OpenBSD: servconf.c,v 1.72 2001/03/25 13:16:10 stevesk Exp $");
|
||||||
|
|
||||||
#ifdef KRB4
|
#ifdef KRB4
|
||||||
#include <krb.h>
|
#include <krb.h>
|
||||||
|
@ -55,6 +55,7 @@ initialize_server_options(ServerOptions *options)
|
||||||
options->ignore_rhosts = -1;
|
options->ignore_rhosts = -1;
|
||||||
options->ignore_user_known_hosts = -1;
|
options->ignore_user_known_hosts = -1;
|
||||||
options->print_motd = -1;
|
options->print_motd = -1;
|
||||||
|
options->print_lastlog = -1;
|
||||||
options->check_mail = -1;
|
options->check_mail = -1;
|
||||||
options->x11_forwarding = -1;
|
options->x11_forwarding = -1;
|
||||||
options->x11_display_offset = -1;
|
options->x11_display_offset = -1;
|
||||||
|
@ -132,6 +133,8 @@ fill_default_server_options(ServerOptions *options)
|
||||||
options->check_mail = 0;
|
options->check_mail = 0;
|
||||||
if (options->print_motd == -1)
|
if (options->print_motd == -1)
|
||||||
options->print_motd = 1;
|
options->print_motd = 1;
|
||||||
|
if (options->print_lastlog == -1)
|
||||||
|
options->print_lastlog = 1;
|
||||||
if (options->x11_forwarding == -1)
|
if (options->x11_forwarding == -1)
|
||||||
options->x11_forwarding = 0;
|
options->x11_forwarding = 0;
|
||||||
if (options->x11_display_offset == -1)
|
if (options->x11_display_offset == -1)
|
||||||
|
@ -208,7 +211,8 @@ typedef enum {
|
||||||
#endif
|
#endif
|
||||||
sChallengeResponseAuthentication,
|
sChallengeResponseAuthentication,
|
||||||
sPasswordAuthentication, sKbdInteractiveAuthentication, sListenAddress,
|
sPasswordAuthentication, sKbdInteractiveAuthentication, sListenAddress,
|
||||||
sPrintMotd, sIgnoreRhosts, sX11Forwarding, sX11DisplayOffset,
|
sPrintMotd, sPrintLastLog, sIgnoreRhosts,
|
||||||
|
sX11Forwarding, sX11DisplayOffset,
|
||||||
sStrictModes, sEmptyPasswd, sKeepAlives, sCheckMail,
|
sStrictModes, sEmptyPasswd, sKeepAlives, sCheckMail,
|
||||||
sUseLogin, sAllowTcpForwarding,
|
sUseLogin, sAllowTcpForwarding,
|
||||||
sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups,
|
sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups,
|
||||||
|
@ -253,6 +257,7 @@ static struct {
|
||||||
{ "checkmail", sCheckMail },
|
{ "checkmail", sCheckMail },
|
||||||
{ "listenaddress", sListenAddress },
|
{ "listenaddress", sListenAddress },
|
||||||
{ "printmotd", sPrintMotd },
|
{ "printmotd", sPrintMotd },
|
||||||
|
{ "printlastlog", sPrintLastLog },
|
||||||
{ "ignorerhosts", sIgnoreRhosts },
|
{ "ignorerhosts", sIgnoreRhosts },
|
||||||
{ "ignoreuserknownhosts", sIgnoreUserKnownHosts },
|
{ "ignoreuserknownhosts", sIgnoreUserKnownHosts },
|
||||||
{ "x11forwarding", sX11Forwarding },
|
{ "x11forwarding", sX11Forwarding },
|
||||||
|
@ -551,6 +556,10 @@ parse_flag:
|
||||||
intptr = &options->print_motd;
|
intptr = &options->print_motd;
|
||||||
goto parse_flag;
|
goto parse_flag;
|
||||||
|
|
||||||
|
case sPrintLastLog:
|
||||||
|
intptr = &options->print_lastlog;
|
||||||
|
goto parse_flag;
|
||||||
|
|
||||||
case sX11Forwarding:
|
case sX11Forwarding:
|
||||||
intptr = &options->x11_forwarding;
|
intptr = &options->x11_forwarding;
|
||||||
goto parse_flag;
|
goto parse_flag;
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
* called by a name other than "ssh" or "Secure Shell".
|
* called by a name other than "ssh" or "Secure Shell".
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* RCSID("$OpenBSD: servconf.h,v 1.38 2001/02/12 16:16:23 markus Exp $"); */
|
/* RCSID("$OpenBSD: servconf.h,v 1.39 2001/03/25 13:16:10 stevesk Exp $"); */
|
||||||
|
|
||||||
#ifndef SERVCONF_H
|
#ifndef SERVCONF_H
|
||||||
#define SERVCONF_H
|
#define SERVCONF_H
|
||||||
|
@ -51,6 +51,7 @@ typedef struct {
|
||||||
int ignore_user_known_hosts; /* Ignore ~/.ssh/known_hosts
|
int ignore_user_known_hosts; /* Ignore ~/.ssh/known_hosts
|
||||||
* for RhostsRsaAuth */
|
* for RhostsRsaAuth */
|
||||||
int print_motd; /* If true, print /etc/motd. */
|
int print_motd; /* If true, print /etc/motd. */
|
||||||
|
int print_lastlog; /* If true, print lastlog */
|
||||||
int check_mail; /* If true, check for new mail. */
|
int check_mail; /* If true, check for new mail. */
|
||||||
int x11_forwarding; /* If true, permit inet (spoofing) X11 fwd. */
|
int x11_forwarding; /* If true, permit inet (spoofing) X11 fwd. */
|
||||||
int x11_display_offset; /* What DISPLAY number to start
|
int x11_display_offset; /* What DISPLAY number to start
|
||||||
|
|
12
session.c
12
session.c
|
@ -33,7 +33,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: session.c,v 1.68 2001/03/25 00:01:34 djm Exp $");
|
RCSID("$OpenBSD: session.c,v 1.69 2001/03/25 13:16:11 stevesk Exp $");
|
||||||
|
|
||||||
#include "ssh.h"
|
#include "ssh.h"
|
||||||
#include "ssh1.h"
|
#include "ssh1.h"
|
||||||
|
@ -718,9 +718,11 @@ do_login(Session *s, const char *command)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the time and hostname when the user last logged in. */
|
/* Get the time and hostname when the user last logged in. */
|
||||||
hostname[0] = '\0';
|
if (options.print_lastlog) {
|
||||||
last_login_time = get_last_login_time(pw->pw_uid, pw->pw_name,
|
hostname[0] = '\0';
|
||||||
hostname, sizeof(hostname));
|
last_login_time = get_last_login_time(pw->pw_uid, pw->pw_name,
|
||||||
|
hostname, sizeof(hostname));
|
||||||
|
}
|
||||||
|
|
||||||
/* Record that there was a login on that tty from the remote host. */
|
/* Record that there was a login on that tty from the remote host. */
|
||||||
record_login(pid, s->tty, pw->pw_name, pw->pw_uid,
|
record_login(pid, s->tty, pw->pw_name, pw->pw_uid,
|
||||||
|
@ -757,7 +759,7 @@ do_login(Session *s, const char *command)
|
||||||
printf("%s\n", aixloginmsg);
|
printf("%s\n", aixloginmsg);
|
||||||
#endif /* WITH_AIXAUTHENTICATE */
|
#endif /* WITH_AIXAUTHENTICATE */
|
||||||
|
|
||||||
if (last_login_time != 0) {
|
if (options.print_lastlog && last_login_time != 0) {
|
||||||
time_string = ctime(&last_login_time);
|
time_string = ctime(&last_login_time);
|
||||||
if (strchr(time_string, '\n'))
|
if (strchr(time_string, '\n'))
|
||||||
*strchr(time_string, '\n') = 0;
|
*strchr(time_string, '\n') = 0;
|
||||||
|
|
8
sshd.8
8
sshd.8
|
@ -34,7 +34,7 @@
|
||||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
.\"
|
.\"
|
||||||
.\" $OpenBSD: sshd.8,v 1.107 2001/03/19 12:10:17 djm Exp $
|
.\" $OpenBSD: sshd.8,v 1.108 2001/03/25 13:16:11 stevesk Exp $
|
||||||
.Dd September 25, 1999
|
.Dd September 25, 1999
|
||||||
.Dt SSHD 8
|
.Dt SSHD 8
|
||||||
.Os
|
.Os
|
||||||
|
@ -593,6 +593,12 @@ Specifies the port number that
|
||||||
listens on.
|
listens on.
|
||||||
The default is 22.
|
The default is 22.
|
||||||
Multiple options of this type are permitted.
|
Multiple options of this type are permitted.
|
||||||
|
.It Cm PrintLastLog
|
||||||
|
Specifies whether
|
||||||
|
.Nm
|
||||||
|
should print the date and time when the user last logged in.
|
||||||
|
The default is
|
||||||
|
.Dq yes .
|
||||||
.It Cm PrintMotd
|
.It Cm PrintMotd
|
||||||
Specifies whether
|
Specifies whether
|
||||||
.Nm
|
.Nm
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# $OpenBSD: sshd_config,v 1.34 2001/02/24 10:37:26 deraadt Exp $
|
# $OpenBSD: sshd_config,v 1.35 2001/03/25 13:16:11 stevesk Exp $
|
||||||
|
|
||||||
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
|
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ StrictModes yes
|
||||||
X11Forwarding no
|
X11Forwarding no
|
||||||
X11DisplayOffset 10
|
X11DisplayOffset 10
|
||||||
PrintMotd yes
|
PrintMotd yes
|
||||||
|
#PrintLastLog no
|
||||||
KeepAlive yes
|
KeepAlive yes
|
||||||
|
|
||||||
# Logging
|
# Logging
|
||||||
|
|
Loading…
Reference in New Issue