servconf.h revision 4a2e944d74dafc80c85d74c8b11430bbecd98824
409N/A/*
409N/A * Author: Tatu Ylonen <ylo@cs.hut.fi>
409N/A * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
409N/A * All rights reserved
409N/A * Definitions for server configuration data and for the functions reading it.
409N/A *
409N/A * As far as I am concerned, the code I have written for this software
409N/A * can be used freely for any purpose. Any derived versions of this
409N/A * software must be clearly marked as such, and if the derived work is
409N/A * incompatible with the protocol description in the RFC file, it must be
409N/A * called by a name other than "ssh" or "Secure Shell".
409N/A */
409N/A/*
409N/A * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
409N/A */
409N/A
409N/A/* $OpenBSD: servconf.h,v 1.59 2002/07/30 17:03:55 markus Exp $ */
409N/A
409N/A#ifndef _SERVCONF_H
409N/A#define _SERVCONF_H
409N/A
409N/A#ifdef __cplusplus
409N/Aextern "C" {
409N/A#endif
409N/A
409N/A#define MAX_PORTS 256 /* Max # ports. */
409N/A
409N/A#define MAX_ALLOW_USERS 256 /* Max # users on allow list. */
409N/A#define MAX_DENY_USERS 256 /* Max # users on deny list. */
409N/A#define MAX_ALLOW_GROUPS 256 /* Max # groups on allow list. */
409N/A#define MAX_DENY_GROUPS 256 /* Max # groups on deny list. */
409N/A#define MAX_SUBSYSTEMS 256 /* Max # subsystems. */
409N/A#define MAX_HOSTKEYS 256 /* Max # hostkeys. */
409N/A
409N/A/* permit_root_login */
409N/A#define PERMIT_NOT_SET -1
409N/A#define PERMIT_NO 0
409N/A#define PERMIT_FORCED_ONLY 1
409N/A#define PERMIT_NO_PASSWD 2
409N/A#define PERMIT_YES 3
409N/A
409N/A/* Magic name for internal sftp-server */
409N/A#define INTERNAL_SFTP_NAME "internal-sftp"
409N/A#define _SSH_PAM_SERVICE_PREFIX "sshd"
409N/A
409N/Atypedef struct {
409N/A u_int num_ports;
409N/A u_int ports_from_cmdline;
409N/A u_short ports[MAX_PORTS]; /* Port number to listen on. */
409N/A char *listen_addr; /* Address on which the server listens. */
409N/A struct addrinfo *listen_addrs; /* Addresses on which the server listens. */
409N/A char *host_key_files[MAX_HOSTKEYS]; /* Files containing host keys. */
409N/A int num_host_key_files; /* Number of files for host keys. */
409N/A char *pid_file; /* Where to put our pid */
409N/A int server_key_bits;/* Size of the server key. */
409N/A int login_grace_time; /* Disconnect if no auth in this time
409N/A * (sec). */
409N/A int key_regeneration_time; /* Server key lifetime (seconds). */
409N/A int permit_root_login; /* PERMIT_*, see above */
409N/A int ignore_rhosts; /* Ignore .rhosts and .shosts. */
409N/A int ignore_user_known_hosts; /* Ignore ~/.ssh/known_hosts
409N/A * for RhostsRsaAuth */
409N/A int print_motd; /* If true, print /etc/motd. */
409N/A int print_lastlog; /* If true, print lastlog */
409N/A int x11_forwarding; /* If true, permit inet (spoofing) X11 fwd. */
409N/A int x11_display_offset; /* What DISPLAY number to start
409N/A * searching at */
409N/A int x11_use_localhost; /* If true, use localhost for fake X11 server. */
409N/A char *xauth_location; /* Location of xauth program */
409N/A int strict_modes; /* If true, require string home dir modes. */
409N/A int keepalives; /* If true, set SO_KEEPALIVE. */
409N/A char *ciphers; /* Supported SSH2 ciphers. */
409N/A char *macs; /* Supported SSH2 macs. */
409N/A int protocol; /* Supported protocol versions. */
409N/A int gateway_ports; /* If true, allow remote connects to forwarded ports. */
409N/A SyslogFacility log_facility; /* Facility for system logging. */
409N/A LogLevel log_level; /* Level for system logging. */
409N/A int rhosts_authentication; /* If true, permit rhosts
409N/A * authentication. */
409N/A int rhosts_rsa_authentication; /* If true, permit rhosts RSA
409N/A * authentication. */
409N/A int hostbased_authentication; /* If true, permit ssh2 hostbased auth */
409N/A int hostbased_uses_name_from_packet_only; /* experimental */
409N/A int rsa_authentication; /* If true, permit RSA authentication. */
409N/A int pubkey_authentication; /* If true, permit ssh2 pubkey authentication. */
409N/A#ifdef GSSAPI
409N/A int gss_authentication;
409N/A int gss_keyex;
409N/A int gss_store_creds;
409N/A int gss_use_session_ccache; /* If true, delegated credentials are
409N/A * stored in a session specific cache */
409N/A int gss_cleanup_creds; /* If true, destroy cred cache on logout */
409N/A#endif /* GSSAPI */
409N/A#if defined(KRB4) || defined(KRB5)
409N/A int kerberos_authentication; /* If true, permit Kerberos
409N/A * authentication. */
409N/A int kerberos_or_local_passwd; /* If true, permit kerberos
409N/A * and any other password
409N/A * authentication mechanism,
409N/A * such as SecurID or
409N/A * /etc/passwd */
409N/A int kerberos_ticket_cleanup; /* If true, destroy ticket
409N/A * file on logout. */
409N/A#endif
409N/A#if defined(AFS) || defined(KRB5)
409N/A int kerberos_tgt_passing; /* If true, permit Kerberos TGT
409N/A * passing. */
409N/A#endif
409N/A#ifdef AFS
409N/A int afs_token_passing; /* If true, permit AFS token passing. */
409N/A#endif
409N/A int password_authentication; /* If true, permit password
409N/A * authentication. */
409N/A
409N/A int kbd_interactive_authentication;
409N/A int challenge_response_authentication;
409N/A int pam_authentication_via_kbd_int;
409N/A
409N/A int permit_empty_passwd; /* If false, do not permit empty
409N/A * passwords. */
409N/A int permit_user_env; /* If true, read ~/.ssh/environment */
409N/A int use_login; /* If true, login(1) is used */
409N/A int compression; /* If true, compression is allowed */
409N/A int allow_tcp_forwarding;
409N/A
409N/A u_int num_allow_users;
409N/A char *allow_users[MAX_ALLOW_USERS];
409N/A u_int num_deny_users;
409N/A char *deny_users[MAX_DENY_USERS];
409N/A u_int num_allow_groups;
409N/A char *allow_groups[MAX_ALLOW_GROUPS];
409N/A u_int num_deny_groups;
409N/A char *deny_groups[MAX_DENY_GROUPS];
409N/A
409N/A u_int num_subsystems;
409N/A char *subsystem_name[MAX_SUBSYSTEMS];
409N/A char *subsystem_command[MAX_SUBSYSTEMS];
409N/A char *subsystem_args[MAX_SUBSYSTEMS];
409N/A
409N/A int max_startups_begin;
409N/A int max_startups_rate;
409N/A int max_startups;
409N/A char *banner; /* SSH-2 banner message */
409N/A int verify_reverse_mapping; /* cross-check ip and dns */
409N/A int client_alive_interval; /*
409N/A * poke the client this often to
409N/A * see if it's still there
409N/A */
409N/A int client_alive_count_max; /*
409N/A * If the client is unresponsive
409N/A * for this many intervals above,
409N/A * disconnect the session
409N/A */
409N/A
409N/A char *authorized_keys_file; /* File containing public keys */
409N/A char *authorized_keys_file2;
int max_auth_tries;
int max_auth_tries_log;
int max_init_auth_tries; /* SUNW: /etc/default/login */
int max_init_auth_tries_log; /* SUNW: /etc/default/login */
int lookup_client_hostnames;
int use_openssl_engine;
char *chroot_directory;
char *pre_userauth_hook;
char *pam_service_prefix;
char *pam_service_name;
} ServerOptions;
void initialize_server_options(ServerOptions *);
void fill_default_server_options(ServerOptions *);
int process_server_config_line(ServerOptions *, char *, const char *, int,
int *, const char *, const char *, const char *);
void load_server_config(const char *, Buffer *);
void parse_server_config(ServerOptions *, const char *, Buffer *,
const char *, const char *, const char *);
void parse_server_match_config(ServerOptions *, const char *, const char *,
const char *);
void copy_set_server_options(ServerOptions *, ServerOptions *, int);
int chroot_requested(char *chroot_directory);
#ifdef __cplusplus
}
#endif
#endif /* _SERVCONF_H */