1511b41d2SMark Murray /* 2511b41d2SMark Murray * 3511b41d2SMark Murray * servconf.h 4511b41d2SMark Murray * 5511b41d2SMark Murray * Author: Tatu Ylonen <ylo@cs.hut.fi> 6511b41d2SMark Murray * 7511b41d2SMark Murray * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 8511b41d2SMark Murray * All rights reserved 9511b41d2SMark Murray * 10511b41d2SMark Murray * Created: Mon Aug 21 15:35:03 1995 ylo 11511b41d2SMark Murray * 12511b41d2SMark Murray * Definitions for server configuration data and for the functions reading it. 13511b41d2SMark Murray * 14511b41d2SMark Murray */ 15511b41d2SMark Murray 16511b41d2SMark Murray /* RCSID("$Id: servconf.h,v 1.15 2000/01/04 00:08:00 markus Exp $"); */ 17511b41d2SMark Murray 18511b41d2SMark Murray #ifndef SERVCONF_H 19511b41d2SMark Murray #define SERVCONF_H 20511b41d2SMark Murray 21511b41d2SMark Murray #define MAX_PORTS 256 /* Max # ports. */ 22511b41d2SMark Murray 23511b41d2SMark Murray #define MAX_ALLOW_USERS 256 /* Max # users on allow list. */ 24511b41d2SMark Murray #define MAX_DENY_USERS 256 /* Max # users on deny list. */ 25511b41d2SMark Murray #define MAX_ALLOW_GROUPS 256 /* Max # groups on allow list. */ 26511b41d2SMark Murray #define MAX_DENY_GROUPS 256 /* Max # groups on deny list. */ 27511b41d2SMark Murray 28511b41d2SMark Murray typedef struct { 29511b41d2SMark Murray unsigned int num_ports; 30511b41d2SMark Murray unsigned int ports_from_cmdline; 31511b41d2SMark Murray u_short ports[MAX_PORTS]; /* Port number to listen on. */ 32511b41d2SMark Murray char *listen_addr; /* Address on which the server listens. */ 33511b41d2SMark Murray struct addrinfo *listen_addrs; /* Addresses on which the server listens. */ 34511b41d2SMark Murray char *host_key_file; /* File containing host key. */ 35511b41d2SMark Murray int server_key_bits;/* Size of the server key. */ 36511b41d2SMark Murray int login_grace_time; /* Disconnect if no auth in this time 37511b41d2SMark Murray * (sec). */ 38511b41d2SMark Murray int key_regeneration_time; /* Server key lifetime (seconds). */ 39511b41d2SMark Murray int permit_root_login; /* If true, permit root login. */ 40511b41d2SMark Murray int ignore_rhosts; /* Ignore .rhosts and .shosts. */ 41511b41d2SMark Murray int ignore_user_known_hosts; /* Ignore ~/.ssh/known_hosts 42511b41d2SMark Murray * for RhostsRsaAuth */ 43511b41d2SMark Murray int print_motd; /* If true, print /etc/motd. */ 44511b41d2SMark Murray int check_mail; /* If true, check for new mail. */ 45511b41d2SMark Murray int x11_forwarding; /* If true, permit inet (spoofing) X11 fwd. */ 46511b41d2SMark Murray int x11_display_offset; /* What DISPLAY number to start 47511b41d2SMark Murray * searching at */ 48511b41d2SMark Murray int strict_modes; /* If true, require string home dir modes. */ 49511b41d2SMark Murray int keepalives; /* If true, set SO_KEEPALIVE. */ 50511b41d2SMark Murray SyslogFacility log_facility; /* Facility for system logging. */ 51511b41d2SMark Murray LogLevel log_level; /* Level for system logging. */ 52511b41d2SMark Murray int rhosts_authentication; /* If true, permit rhosts 53511b41d2SMark Murray * authentication. */ 54511b41d2SMark Murray int rhosts_rsa_authentication; /* If true, permit rhosts RSA 55511b41d2SMark Murray * authentication. */ 56511b41d2SMark Murray int rsa_authentication; /* If true, permit RSA authentication. */ 57511b41d2SMark Murray #ifdef KRB4 58511b41d2SMark Murray int kerberos_authentication; /* If true, permit Kerberos 59511b41d2SMark Murray * authentication. */ 60511b41d2SMark Murray int kerberos_or_local_passwd; /* If true, permit kerberos 61511b41d2SMark Murray * and any other password 62511b41d2SMark Murray * authentication mechanism, 63511b41d2SMark Murray * such as SecurID or 64511b41d2SMark Murray * /etc/passwd */ 65511b41d2SMark Murray int kerberos_ticket_cleanup; /* If true, destroy ticket 66511b41d2SMark Murray * file on logout. */ 67511b41d2SMark Murray #endif 68511b41d2SMark Murray #ifdef AFS 69511b41d2SMark Murray int kerberos_tgt_passing; /* If true, permit Kerberos tgt 70511b41d2SMark Murray * passing. */ 71511b41d2SMark Murray int afs_token_passing; /* If true, permit AFS token passing. */ 72511b41d2SMark Murray #endif 73511b41d2SMark Murray int password_authentication; /* If true, permit password 74511b41d2SMark Murray * authentication. */ 75511b41d2SMark Murray #ifdef SKEY 76511b41d2SMark Murray int skey_authentication; /* If true, permit s/key 77511b41d2SMark Murray * authentication. */ 78511b41d2SMark Murray #endif 79511b41d2SMark Murray int permit_empty_passwd; /* If false, do not permit empty 80511b41d2SMark Murray * passwords. */ 81511b41d2SMark Murray int use_login; /* If true, login(1) is used */ 82511b41d2SMark Murray unsigned int num_allow_users; 83511b41d2SMark Murray char *allow_users[MAX_ALLOW_USERS]; 84511b41d2SMark Murray unsigned int num_deny_users; 85511b41d2SMark Murray char *deny_users[MAX_DENY_USERS]; 86511b41d2SMark Murray unsigned int num_allow_groups; 87511b41d2SMark Murray char *allow_groups[MAX_ALLOW_GROUPS]; 88511b41d2SMark Murray unsigned int num_deny_groups; 89511b41d2SMark Murray char *deny_groups[MAX_DENY_GROUPS]; 90511b41d2SMark Murray } ServerOptions; 91511b41d2SMark Murray /* 92511b41d2SMark Murray * Initializes the server options to special values that indicate that they 93511b41d2SMark Murray * have not yet been set. 94511b41d2SMark Murray */ 95511b41d2SMark Murray void initialize_server_options(ServerOptions * options); 96511b41d2SMark Murray 97511b41d2SMark Murray /* 98511b41d2SMark Murray * Reads the server configuration file. This only sets the values for those 99511b41d2SMark Murray * options that have the special value indicating they have not been set. 100511b41d2SMark Murray */ 101511b41d2SMark Murray void read_server_config(ServerOptions * options, const char *filename); 102511b41d2SMark Murray 103511b41d2SMark Murray /* Sets values for those values that have not yet been set. */ 104511b41d2SMark Murray void fill_default_server_options(ServerOptions * options); 105511b41d2SMark Murray 106511b41d2SMark Murray #endif /* SERVCONF_H */ 107