121e764dfSDag-Erling Smørgrav /* $OpenBSD: servconf.h,v 1.70 2004/06/24 19:30:54 djm Exp $ */ 2f388f5efSDag-Erling Smørgrav /* $FreeBSD$ */ 3af12a3e7SDag-Erling Smørgrav 4511b41d2SMark Murray /* 5511b41d2SMark Murray * Author: Tatu Ylonen <ylo@cs.hut.fi> 6511b41d2SMark Murray * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 7511b41d2SMark Murray * All rights reserved 8511b41d2SMark Murray * Definitions for server configuration data and for the functions reading it. 9511b41d2SMark Murray * 10c2d3a559SKris Kennaway * As far as I am concerned, the code I have written for this software 11c2d3a559SKris Kennaway * can be used freely for any purpose. Any derived versions of this 12c2d3a559SKris Kennaway * software must be clearly marked as such, and if the derived work is 13c2d3a559SKris Kennaway * incompatible with the protocol description in the RFC file, it must be 14c2d3a559SKris Kennaway * called by a name other than "ssh" or "Secure Shell". 15511b41d2SMark Murray */ 16511b41d2SMark Murray 17511b41d2SMark Murray #ifndef SERVCONF_H 18511b41d2SMark Murray #define SERVCONF_H 19511b41d2SMark Murray 2021e764dfSDag-Erling Smørgrav #include "buffer.h" 2121e764dfSDag-Erling Smørgrav 22511b41d2SMark Murray #define MAX_PORTS 256 /* Max # ports. */ 23511b41d2SMark Murray 24511b41d2SMark Murray #define MAX_ALLOW_USERS 256 /* Max # users on allow list. */ 25511b41d2SMark Murray #define MAX_DENY_USERS 256 /* Max # users on deny list. */ 26511b41d2SMark Murray #define MAX_ALLOW_GROUPS 256 /* Max # groups on allow list. */ 27511b41d2SMark Murray #define MAX_DENY_GROUPS 256 /* Max # groups on deny list. */ 28c2d3a559SKris Kennaway #define MAX_SUBSYSTEMS 256 /* Max # subsystems. */ 29ca3176e7SBrian Feldman #define MAX_HOSTKEYS 256 /* Max # hostkeys. */ 3021e764dfSDag-Erling Smørgrav #define MAX_ACCEPT_ENV 256 /* Max # of env vars. */ 31ca3176e7SBrian Feldman 32ca3176e7SBrian Feldman /* permit_root_login */ 33ca3176e7SBrian Feldman #define PERMIT_NOT_SET -1 34ca3176e7SBrian Feldman #define PERMIT_NO 0 35ca3176e7SBrian Feldman #define PERMIT_FORCED_ONLY 1 36ca3176e7SBrian Feldman #define PERMIT_NO_PASSWD 2 37ca3176e7SBrian Feldman #define PERMIT_YES 3 38ca3176e7SBrian Feldman 3921e764dfSDag-Erling Smørgrav #define DEFAULT_AUTH_FAIL_MAX 6 /* Default for MaxAuthTries */ 40511b41d2SMark Murray 41511b41d2SMark Murray typedef struct { 42ca3176e7SBrian Feldman u_int num_ports; 43ca3176e7SBrian Feldman u_int ports_from_cmdline; 44511b41d2SMark Murray u_short ports[MAX_PORTS]; /* Port number to listen on. */ 45511b41d2SMark Murray char *listen_addr; /* Address on which the server listens. */ 46511b41d2SMark Murray struct addrinfo *listen_addrs; /* Addresses on which the server listens. */ 47ca3176e7SBrian Feldman char *host_key_files[MAX_HOSTKEYS]; /* Files containing host keys. */ 48ca3176e7SBrian Feldman int num_host_key_files; /* Number of files for host keys. */ 49e8aafc91SKris Kennaway char *pid_file; /* Where to put our pid */ 50511b41d2SMark Murray int server_key_bits;/* Size of the server key. */ 51511b41d2SMark Murray int login_grace_time; /* Disconnect if no auth in this time 52511b41d2SMark Murray * (sec). */ 53511b41d2SMark Murray int key_regeneration_time; /* Server key lifetime (seconds). */ 54ca3176e7SBrian Feldman int permit_root_login; /* PERMIT_*, see above */ 55511b41d2SMark Murray int ignore_rhosts; /* Ignore .rhosts and .shosts. */ 56511b41d2SMark Murray int ignore_user_known_hosts; /* Ignore ~/.ssh/known_hosts 57511b41d2SMark Murray * for RhostsRsaAuth */ 58511b41d2SMark Murray int print_motd; /* If true, print /etc/motd. */ 59ca3176e7SBrian Feldman int print_lastlog; /* If true, print lastlog */ 60511b41d2SMark Murray int x11_forwarding; /* If true, permit inet (spoofing) X11 fwd. */ 61511b41d2SMark Murray int x11_display_offset; /* What DISPLAY number to start 62511b41d2SMark Murray * searching at */ 63af12a3e7SDag-Erling Smørgrav int x11_use_localhost; /* If true, use localhost for fake X11 server. */ 64c2d3a559SKris Kennaway char *xauth_location; /* Location of xauth program */ 65511b41d2SMark Murray int strict_modes; /* If true, require string home dir modes. */ 661ec0d754SDag-Erling Smørgrav int tcp_keep_alive; /* If true, set SO_KEEPALIVE. */ 67ca3176e7SBrian Feldman char *ciphers; /* Supported SSH2 ciphers. */ 68ca3176e7SBrian Feldman char *macs; /* Supported SSH2 macs. */ 69ca3176e7SBrian Feldman int protocol; /* Supported protocol versions. */ 70e8aafc91SKris Kennaway int gateway_ports; /* If true, allow remote connects to forwarded ports. */ 71511b41d2SMark Murray SyslogFacility log_facility; /* Facility for system logging. */ 72511b41d2SMark Murray LogLevel log_level; /* Level for system logging. */ 73511b41d2SMark Murray int rhosts_rsa_authentication; /* If true, permit rhosts RSA 74511b41d2SMark Murray * authentication. */ 75ca3176e7SBrian Feldman int hostbased_authentication; /* If true, permit ssh2 hostbased auth */ 76ca3176e7SBrian Feldman int hostbased_uses_name_from_packet_only; /* experimental */ 77511b41d2SMark Murray int rsa_authentication; /* If true, permit RSA authentication. */ 78ca3176e7SBrian Feldman int pubkey_authentication; /* If true, permit ssh2 pubkey authentication. */ 79af12a3e7SDag-Erling Smørgrav int kerberos_authentication; /* If true, permit Kerberos 80af12a3e7SDag-Erling Smørgrav * authentication. */ 81af12a3e7SDag-Erling Smørgrav int kerberos_or_local_passwd; /* If true, permit kerberos 82511b41d2SMark Murray * and any other password 83511b41d2SMark Murray * authentication mechanism, 84511b41d2SMark Murray * such as SecurID or 85511b41d2SMark Murray * /etc/passwd */ 86af12a3e7SDag-Erling Smørgrav int kerberos_ticket_cleanup; /* If true, destroy ticket 87511b41d2SMark Murray * file on logout. */ 881ec0d754SDag-Erling Smørgrav int kerberos_get_afs_token; /* If true, try to get AFS token if 891ec0d754SDag-Erling Smørgrav * authenticated with Kerberos. */ 90cf2b5f3bSDag-Erling Smørgrav int gss_authentication; /* If true, permit GSSAPI authentication */ 91cf2b5f3bSDag-Erling Smørgrav int gss_cleanup_creds; /* If true, destroy cred cache on logout */ 92511b41d2SMark Murray int password_authentication; /* If true, permit password 93511b41d2SMark Murray * authentication. */ 9409958426SBrian Feldman int kbd_interactive_authentication; /* If true, permit */ 95af12a3e7SDag-Erling Smørgrav int challenge_response_authentication; 96511b41d2SMark Murray int permit_empty_passwd; /* If false, do not permit empty 97511b41d2SMark Murray * passwords. */ 98f388f5efSDag-Erling Smørgrav int permit_user_env; /* If true, read ~/.ssh/environment */ 99511b41d2SMark Murray int use_login; /* If true, login(1) is used */ 10080628bacSDag-Erling Smørgrav int compression; /* If true, compression is allowed */ 10109958426SBrian Feldman int allow_tcp_forwarding; 102ca3176e7SBrian Feldman u_int num_allow_users; 103511b41d2SMark Murray char *allow_users[MAX_ALLOW_USERS]; 104ca3176e7SBrian Feldman u_int num_deny_users; 105511b41d2SMark Murray char *deny_users[MAX_DENY_USERS]; 106ca3176e7SBrian Feldman u_int num_allow_groups; 107511b41d2SMark Murray char *allow_groups[MAX_ALLOW_GROUPS]; 108ca3176e7SBrian Feldman u_int num_deny_groups; 109511b41d2SMark Murray char *deny_groups[MAX_DENY_GROUPS]; 110c2d3a559SKris Kennaway 111ca3176e7SBrian Feldman u_int num_subsystems; 112c2d3a559SKris Kennaway char *subsystem_name[MAX_SUBSYSTEMS]; 113c2d3a559SKris Kennaway char *subsystem_command[MAX_SUBSYSTEMS]; 114c2d3a559SKris Kennaway 11521e764dfSDag-Erling Smørgrav u_int num_accept_env; 11621e764dfSDag-Erling Smørgrav char *accept_env[MAX_ACCEPT_ENV]; 11721e764dfSDag-Erling Smørgrav 118c2d3a559SKris Kennaway int max_startups_begin; 119c2d3a559SKris Kennaway int max_startups_rate; 120c2d3a559SKris Kennaway int max_startups; 12121e764dfSDag-Erling Smørgrav int max_authtries; 122ca3176e7SBrian Feldman char *banner; /* SSH-2 banner message */ 123cf2b5f3bSDag-Erling Smørgrav int use_dns; 124ca3176e7SBrian Feldman int client_alive_interval; /* 125ca3176e7SBrian Feldman * poke the client this often to 126ca3176e7SBrian Feldman * see if it's still there 127ca3176e7SBrian Feldman */ 128ca3176e7SBrian Feldman int client_alive_count_max; /* 129ca3176e7SBrian Feldman * If the client is unresponsive 130af12a3e7SDag-Erling Smørgrav * for this many intervals above, 131af12a3e7SDag-Erling Smørgrav * disconnect the session 132ca3176e7SBrian Feldman */ 133c2d3a559SKris Kennaway 134af12a3e7SDag-Erling Smørgrav char *authorized_keys_file; /* File containing public keys */ 135af12a3e7SDag-Erling Smørgrav char *authorized_keys_file2; 136cf2b5f3bSDag-Erling Smørgrav int use_pam; /* Enable auth via PAM */ 137511b41d2SMark Murray } ServerOptions; 138511b41d2SMark Murray 139af12a3e7SDag-Erling Smørgrav void initialize_server_options(ServerOptions *); 140af12a3e7SDag-Erling Smørgrav void fill_default_server_options(ServerOptions *); 141af12a3e7SDag-Erling Smørgrav int process_server_config_line(ServerOptions *, char *, const char *, int); 14221e764dfSDag-Erling Smørgrav void load_server_config(const char *, Buffer *); 14321e764dfSDag-Erling Smørgrav void parse_server_config(ServerOptions *, const char *, Buffer *); 144511b41d2SMark Murray 145511b41d2SMark Murray #endif /* SERVCONF_H */ 146