1511b41d2SMark Murray /* 2511b41d2SMark Murray * Author: Tatu Ylonen <ylo@cs.hut.fi> 3511b41d2SMark Murray * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4511b41d2SMark Murray * All rights reserved 5511b41d2SMark Murray * Definitions for server configuration data and for the functions reading it. 6511b41d2SMark Murray * 7c2d3a559SKris Kennaway * As far as I am concerned, the code I have written for this software 8c2d3a559SKris Kennaway * can be used freely for any purpose. Any derived versions of this 9c2d3a559SKris Kennaway * software must be clearly marked as such, and if the derived work is 10c2d3a559SKris Kennaway * incompatible with the protocol description in the RFC file, it must be 11c2d3a559SKris Kennaway * called by a name other than "ssh" or "Secure Shell". 12511b41d2SMark Murray */ 13511b41d2SMark Murray 14ca3176e7SBrian Feldman /* RCSID("$OpenBSD: servconf.h,v 1.41 2001/04/13 22:46:53 beck Exp $"); */ 15ca3176e7SBrian Feldman /* RCSID("$FreeBSD$"); */ 16511b41d2SMark Murray 17511b41d2SMark Murray #ifndef SERVCONF_H 18511b41d2SMark Murray #define SERVCONF_H 19511b41d2SMark Murray 20511b41d2SMark Murray #define MAX_PORTS 256 /* Max # ports. */ 21511b41d2SMark Murray 22511b41d2SMark Murray #define MAX_ALLOW_USERS 256 /* Max # users on allow list. */ 23511b41d2SMark Murray #define MAX_DENY_USERS 256 /* Max # users on deny list. */ 24511b41d2SMark Murray #define MAX_ALLOW_GROUPS 256 /* Max # groups on allow list. */ 25511b41d2SMark Murray #define MAX_DENY_GROUPS 256 /* Max # groups on deny list. */ 26c2d3a559SKris Kennaway #define MAX_SUBSYSTEMS 256 /* Max # subsystems. */ 27ca3176e7SBrian Feldman #define MAX_HOSTKEYS 256 /* Max # hostkeys. */ 28ca3176e7SBrian Feldman 29ca3176e7SBrian Feldman /* permit_root_login */ 30ca3176e7SBrian Feldman #define PERMIT_NOT_SET -1 31ca3176e7SBrian Feldman #define PERMIT_NO 0 32ca3176e7SBrian Feldman #define PERMIT_FORCED_ONLY 1 33ca3176e7SBrian Feldman #define PERMIT_NO_PASSWD 2 34ca3176e7SBrian Feldman #define PERMIT_YES 3 35ca3176e7SBrian Feldman 36511b41d2SMark Murray 37511b41d2SMark Murray typedef struct { 38ca3176e7SBrian Feldman u_int num_ports; 39ca3176e7SBrian Feldman u_int ports_from_cmdline; 40511b41d2SMark Murray u_short ports[MAX_PORTS]; /* Port number to listen on. */ 41511b41d2SMark Murray char *listen_addr; /* Address on which the server listens. */ 42511b41d2SMark Murray struct addrinfo *listen_addrs; /* Addresses on which the server listens. */ 43ca3176e7SBrian Feldman char *host_key_files[MAX_HOSTKEYS]; /* Files containing host keys. */ 44ca3176e7SBrian Feldman int num_host_key_files; /* Number of files for host keys. */ 45e8aafc91SKris Kennaway char *pid_file; /* Where to put our pid */ 46511b41d2SMark Murray int server_key_bits;/* Size of the server key. */ 47511b41d2SMark Murray int login_grace_time; /* Disconnect if no auth in this time 48511b41d2SMark Murray * (sec). */ 49511b41d2SMark Murray int key_regeneration_time; /* Server key lifetime (seconds). */ 50ca3176e7SBrian Feldman int permit_root_login; /* PERMIT_*, see above */ 51511b41d2SMark Murray int ignore_rhosts; /* Ignore .rhosts and .shosts. */ 52511b41d2SMark Murray int ignore_user_known_hosts; /* Ignore ~/.ssh/known_hosts 53511b41d2SMark Murray * for RhostsRsaAuth */ 54511b41d2SMark Murray int print_motd; /* If true, print /etc/motd. */ 55ca3176e7SBrian Feldman int print_lastlog; /* If true, print lastlog */ 56511b41d2SMark Murray int check_mail; /* If true, check for new mail. */ 57511b41d2SMark Murray int x11_forwarding; /* If true, permit inet (spoofing) X11 fwd. */ 58511b41d2SMark Murray int x11_display_offset; /* What DISPLAY number to start 59511b41d2SMark Murray * searching at */ 60c2d3a559SKris Kennaway char *xauth_location; /* Location of xauth program */ 61511b41d2SMark Murray int strict_modes; /* If true, require string home dir modes. */ 62511b41d2SMark Murray int keepalives; /* If true, set SO_KEEPALIVE. */ 63ca3176e7SBrian Feldman char *ciphers; /* Supported SSH2 ciphers. */ 64ca3176e7SBrian Feldman char *macs; /* Supported SSH2 macs. */ 65ca3176e7SBrian Feldman int protocol; /* Supported protocol versions. */ 66e8aafc91SKris Kennaway int gateway_ports; /* If true, allow remote connects to forwarded ports. */ 67511b41d2SMark Murray SyslogFacility log_facility; /* Facility for system logging. */ 68511b41d2SMark Murray LogLevel log_level; /* Level for system logging. */ 69511b41d2SMark Murray int rhosts_authentication; /* If true, permit rhosts 70511b41d2SMark Murray * authentication. */ 71511b41d2SMark Murray int rhosts_rsa_authentication; /* If true, permit rhosts RSA 72511b41d2SMark Murray * authentication. */ 73ca3176e7SBrian Feldman int hostbased_authentication; /* If true, permit ssh2 hostbased auth */ 74ca3176e7SBrian Feldman int hostbased_uses_name_from_packet_only; /* experimental */ 75511b41d2SMark Murray int rsa_authentication; /* If true, permit RSA authentication. */ 76cb96ab36SAssar Westerlund #if defined(KRB4) || defined(KRB5) 77cb96ab36SAssar Westerlund int kerberos_authentication; /* If true, permit Kerberos auth. */ 78cb96ab36SAssar Westerlund #endif /* KRB4 || KRB5 */ 79ca3176e7SBrian Feldman int pubkey_authentication; /* If true, permit ssh2 pubkey authentication. */ 80511b41d2SMark Murray #ifdef KRB4 81fe5fd017SMark Murray int krb4_or_local_passwd; /* If true, permit kerberos v4 82511b41d2SMark Murray * and any other password 83511b41d2SMark Murray * authentication mechanism, 84511b41d2SMark Murray * such as SecurID or 85511b41d2SMark Murray * /etc/passwd */ 86fe5fd017SMark Murray int krb4_ticket_cleanup; /* If true, destroy ticket 87511b41d2SMark Murray * file on logout. */ 88511b41d2SMark Murray #endif 89fe5fd017SMark Murray #ifdef KRB5 90fe5fd017SMark Murray int krb5_tgt_passing; 91fe5fd017SMark Murray 92fe5fd017SMark Murray #endif /* KRB5 */ 93511b41d2SMark Murray #ifdef AFS 94fe5fd017SMark Murray int krb4_tgt_passing; /* If true, permit Kerberos v4 tgt 95511b41d2SMark Murray * passing. */ 96511b41d2SMark Murray int afs_token_passing; /* If true, permit AFS token passing. */ 97511b41d2SMark Murray #endif 98511b41d2SMark Murray int password_authentication; /* If true, permit password 99511b41d2SMark Murray * authentication. */ 10009958426SBrian Feldman int kbd_interactive_authentication; /* If true, permit */ 101ca3176e7SBrian Feldman int challenge_reponse_authentication; 102511b41d2SMark Murray int permit_empty_passwd; /* If false, do not permit empty 103511b41d2SMark Murray * passwords. */ 104511b41d2SMark Murray int use_login; /* If true, login(1) is used */ 10509958426SBrian Feldman int allow_tcp_forwarding; 106ca3176e7SBrian Feldman u_int num_allow_users; 107511b41d2SMark Murray char *allow_users[MAX_ALLOW_USERS]; 108ca3176e7SBrian Feldman u_int num_deny_users; 109511b41d2SMark Murray char *deny_users[MAX_DENY_USERS]; 110ca3176e7SBrian Feldman u_int num_allow_groups; 111511b41d2SMark Murray char *allow_groups[MAX_ALLOW_GROUPS]; 112ca3176e7SBrian Feldman u_int num_deny_groups; 113511b41d2SMark Murray char *deny_groups[MAX_DENY_GROUPS]; 11442f71286SMark Murray unsigned int connections_per_period; /* 11542f71286SMark Murray * If not 0, number of sshd 11642f71286SMark Murray * connections accepted per 11742f71286SMark Murray * connections_period. 11842f71286SMark Murray */ 11942f71286SMark Murray unsigned int connections_period; 120c2d3a559SKris Kennaway 121ca3176e7SBrian Feldman u_int num_subsystems; 122c2d3a559SKris Kennaway char *subsystem_name[MAX_SUBSYSTEMS]; 123c2d3a559SKris Kennaway char *subsystem_command[MAX_SUBSYSTEMS]; 124c2d3a559SKris Kennaway 125c2d3a559SKris Kennaway int max_startups_begin; 126c2d3a559SKris Kennaway int max_startups_rate; 127c2d3a559SKris Kennaway int max_startups; 128ca3176e7SBrian Feldman char *banner; /* SSH-2 banner message */ 129ca3176e7SBrian Feldman int reverse_mapping_check; /* cross-check ip and dns */ 130ca3176e7SBrian Feldman int client_alive_interval; /* 131ca3176e7SBrian Feldman * poke the client this often to 132ca3176e7SBrian Feldman * see if it's still there 133ca3176e7SBrian Feldman */ 134ca3176e7SBrian Feldman int client_alive_count_max; /* 135ca3176e7SBrian Feldman *If the client is unresponsive 136ca3176e7SBrian Feldman * for this many intervals, above 137ca3176e7SBrian Feldman * diconnect the session 138ca3176e7SBrian Feldman */ 139c2d3a559SKris Kennaway 140511b41d2SMark Murray } ServerOptions; 141511b41d2SMark Murray /* 142511b41d2SMark Murray * Initializes the server options to special values that indicate that they 143511b41d2SMark Murray * have not yet been set. 144511b41d2SMark Murray */ 145511b41d2SMark Murray void initialize_server_options(ServerOptions * options); 146511b41d2SMark Murray 147511b41d2SMark Murray /* 148511b41d2SMark Murray * Reads the server configuration file. This only sets the values for those 149511b41d2SMark Murray * options that have the special value indicating they have not been set. 150511b41d2SMark Murray */ 151511b41d2SMark Murray void read_server_config(ServerOptions * options, const char *filename); 152511b41d2SMark Murray 153511b41d2SMark Murray /* Sets values for those values that have not yet been set. */ 154511b41d2SMark Murray void fill_default_server_options(ServerOptions * options); 155511b41d2SMark Murray 156511b41d2SMark Murray #endif /* SERVCONF_H */ 157