servconf.h revision 157019
1157019Sdes/* $OpenBSD: servconf.h,v 1.72 2005/12/06 22:38:27 reyk Exp $ */ 2106130Sdes/* $FreeBSD: head/crypto/openssh/servconf.h 157019 2006-03-22 20:41:37Z des $ */ 392559Sdes 457429Smarkm/* 557429Smarkm * Author: Tatu Ylonen <ylo@cs.hut.fi> 657429Smarkm * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 757429Smarkm * All rights reserved 857429Smarkm * Definitions for server configuration data and for the functions reading it. 960576Skris * 1065674Skris * As far as I am concerned, the code I have written for this software 1165674Skris * can be used freely for any purpose. Any derived versions of this 1265674Skris * software must be clearly marked as such, and if the derived work is 1365674Skris * incompatible with the protocol description in the RFC file, it must be 1465674Skris * called by a name other than "ssh" or "Secure Shell". 1557429Smarkm */ 1657429Smarkm 1757429Smarkm#ifndef SERVCONF_H 1857429Smarkm#define SERVCONF_H 1957429Smarkm 20137019Sdes#include "buffer.h" 21137019Sdes 2257429Smarkm#define MAX_PORTS 256 /* Max # ports. */ 2357429Smarkm 2457429Smarkm#define MAX_ALLOW_USERS 256 /* Max # users on allow list. */ 2557429Smarkm#define MAX_DENY_USERS 256 /* Max # users on deny list. */ 2657429Smarkm#define MAX_ALLOW_GROUPS 256 /* Max # groups on allow list. */ 2757429Smarkm#define MAX_DENY_GROUPS 256 /* Max # groups on deny list. */ 2865674Skris#define MAX_SUBSYSTEMS 256 /* Max # subsystems. */ 2976262Sgreen#define MAX_HOSTKEYS 256 /* Max # hostkeys. */ 30137019Sdes#define MAX_ACCEPT_ENV 256 /* Max # of env vars. */ 3157429Smarkm 3276262Sgreen/* permit_root_login */ 3376262Sgreen#define PERMIT_NOT_SET -1 3476262Sgreen#define PERMIT_NO 0 3576262Sgreen#define PERMIT_FORCED_ONLY 1 3676262Sgreen#define PERMIT_NO_PASSWD 2 3776262Sgreen#define PERMIT_YES 3 3876262Sgreen 39137019Sdes#define DEFAULT_AUTH_FAIL_MAX 6 /* Default for MaxAuthTries */ 4076262Sgreen 4157429Smarkmtypedef struct { 4276262Sgreen u_int num_ports; 4376262Sgreen u_int ports_from_cmdline; 4457429Smarkm u_short ports[MAX_PORTS]; /* Port number to listen on. */ 4557429Smarkm char *listen_addr; /* Address on which the server listens. */ 4657429Smarkm struct addrinfo *listen_addrs; /* Addresses on which the server listens. */ 47147005Sdes int address_family; /* Address family used by the server. */ 4876262Sgreen char *host_key_files[MAX_HOSTKEYS]; /* Files containing host keys. */ 4976262Sgreen int num_host_key_files; /* Number of files for host keys. */ 5060576Skris char *pid_file; /* Where to put our pid */ 5157429Smarkm int server_key_bits;/* Size of the server key. */ 5257429Smarkm int login_grace_time; /* Disconnect if no auth in this time 5357429Smarkm * (sec). */ 5457429Smarkm int key_regeneration_time; /* Server key lifetime (seconds). */ 5576262Sgreen int permit_root_login; /* PERMIT_*, see above */ 5657429Smarkm int ignore_rhosts; /* Ignore .rhosts and .shosts. */ 5757429Smarkm int ignore_user_known_hosts; /* Ignore ~/.ssh/known_hosts 5857429Smarkm * for RhostsRsaAuth */ 5957429Smarkm int print_motd; /* If true, print /etc/motd. */ 6076262Sgreen int print_lastlog; /* If true, print lastlog */ 6157429Smarkm int x11_forwarding; /* If true, permit inet (spoofing) X11 fwd. */ 6257429Smarkm int x11_display_offset; /* What DISPLAY number to start 6357429Smarkm * searching at */ 6492559Sdes int x11_use_localhost; /* If true, use localhost for fake X11 server. */ 6565674Skris char *xauth_location; /* Location of xauth program */ 6657429Smarkm int strict_modes; /* If true, require string home dir modes. */ 67126277Sdes int tcp_keep_alive; /* If true, set SO_KEEPALIVE. */ 6876262Sgreen char *ciphers; /* Supported SSH2 ciphers. */ 6976262Sgreen char *macs; /* Supported SSH2 macs. */ 7076262Sgreen int protocol; /* Supported protocol versions. */ 7160576Skris int gateway_ports; /* If true, allow remote connects to forwarded ports. */ 7257429Smarkm SyslogFacility log_facility; /* Facility for system logging. */ 7357429Smarkm LogLevel log_level; /* Level for system logging. */ 7457429Smarkm int rhosts_rsa_authentication; /* If true, permit rhosts RSA 7557429Smarkm * authentication. */ 7676262Sgreen int hostbased_authentication; /* If true, permit ssh2 hostbased auth */ 7776262Sgreen int hostbased_uses_name_from_packet_only; /* experimental */ 7857429Smarkm int rsa_authentication; /* If true, permit RSA authentication. */ 7992559Sdes int pubkey_authentication; /* If true, permit ssh2 pubkey authentication. */ 8092559Sdes int kerberos_authentication; /* If true, permit Kerberos 8192559Sdes * authentication. */ 8292559Sdes int kerberos_or_local_passwd; /* If true, permit kerberos 8357429Smarkm * and any other password 8457429Smarkm * authentication mechanism, 8557429Smarkm * such as SecurID or 8657429Smarkm * /etc/passwd */ 8792559Sdes int kerberos_ticket_cleanup; /* If true, destroy ticket 8857429Smarkm * file on logout. */ 89126277Sdes int kerberos_get_afs_token; /* If true, try to get AFS token if 90126277Sdes * authenticated with Kerberos. */ 91124211Sdes int gss_authentication; /* If true, permit GSSAPI authentication */ 92124211Sdes int gss_cleanup_creds; /* If true, destroy cred cache on logout */ 9357429Smarkm int password_authentication; /* If true, permit password 9457429Smarkm * authentication. */ 9569591Sgreen int kbd_interactive_authentication; /* If true, permit */ 9692559Sdes int challenge_response_authentication; 9757429Smarkm int permit_empty_passwd; /* If false, do not permit empty 9857429Smarkm * passwords. */ 99106130Sdes int permit_user_env; /* If true, read ~/.ssh/environment */ 10057429Smarkm int use_login; /* If true, login(1) is used */ 10198684Sdes int compression; /* If true, compression is allowed */ 10269591Sgreen int allow_tcp_forwarding; 10376262Sgreen u_int num_allow_users; 10457429Smarkm char *allow_users[MAX_ALLOW_USERS]; 10576262Sgreen u_int num_deny_users; 10657429Smarkm char *deny_users[MAX_DENY_USERS]; 10776262Sgreen u_int num_allow_groups; 10857429Smarkm char *allow_groups[MAX_ALLOW_GROUPS]; 10976262Sgreen u_int num_deny_groups; 11057429Smarkm char *deny_groups[MAX_DENY_GROUPS]; 11165674Skris 11276262Sgreen u_int num_subsystems; 11365674Skris char *subsystem_name[MAX_SUBSYSTEMS]; 11465674Skris char *subsystem_command[MAX_SUBSYSTEMS]; 11565674Skris 116137019Sdes u_int num_accept_env; 117137019Sdes char *accept_env[MAX_ACCEPT_ENV]; 118137019Sdes 11965674Skris int max_startups_begin; 12065674Skris int max_startups_rate; 12165674Skris int max_startups; 122137019Sdes int max_authtries; 12376262Sgreen char *banner; /* SSH-2 banner message */ 124124211Sdes int use_dns; 12576262Sgreen int client_alive_interval; /* 12692559Sdes * poke the client this often to 12792559Sdes * see if it's still there 12876262Sgreen */ 12976262Sgreen int client_alive_count_max; /* 13092559Sdes * If the client is unresponsive 13192559Sdes * for this many intervals above, 13292559Sdes * disconnect the session 13376262Sgreen */ 13465674Skris 13592559Sdes char *authorized_keys_file; /* File containing public keys */ 13692559Sdes char *authorized_keys_file2; 137157019Sdes 138124211Sdes int use_pam; /* Enable auth via PAM */ 139157019Sdes 140157019Sdes int permit_tun; 14157429Smarkm} ServerOptions; 14257429Smarkm 14392559Sdesvoid initialize_server_options(ServerOptions *); 14492559Sdesvoid fill_default_server_options(ServerOptions *); 14592559Sdesint process_server_config_line(ServerOptions *, char *, const char *, int); 146137019Sdesvoid load_server_config(const char *, Buffer *); 147137019Sdesvoid parse_server_config(ServerOptions *, const char *, Buffer *); 14857429Smarkm 14957429Smarkm#endif /* SERVCONF_H */ 150