servconf.h revision 57429
1219820Sjeff/* 2219820Sjeff * 3219820Sjeff * servconf.h 4219820Sjeff * 5270710Shselasky * Author: Tatu Ylonen <ylo@cs.hut.fi> 6219820Sjeff * 7219820Sjeff * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 8219820Sjeff * All rights reserved 9219820Sjeff * 10219820Sjeff * Created: Mon Aug 21 15:35:03 1995 ylo 11219820Sjeff * 12219820Sjeff * Definitions for server configuration data and for the functions reading it. 13219820Sjeff * 14219820Sjeff */ 15219820Sjeff 16219820Sjeff/* RCSID("$Id: servconf.h,v 1.15 2000/01/04 00:08:00 markus Exp $"); */ 17219820Sjeff 18219820Sjeff#ifndef SERVCONF_H 19219820Sjeff#define SERVCONF_H 20219820Sjeff 21219820Sjeff#define MAX_PORTS 256 /* Max # ports. */ 22219820Sjeff 23219820Sjeff#define MAX_ALLOW_USERS 256 /* Max # users on allow list. */ 24219820Sjeff#define MAX_DENY_USERS 256 /* Max # users on deny list. */ 25219820Sjeff#define MAX_ALLOW_GROUPS 256 /* Max # groups on allow list. */ 26219820Sjeff#define MAX_DENY_GROUPS 256 /* Max # groups on deny list. */ 27219820Sjeff 28289644Shselaskytypedef struct { 29289644Shselasky unsigned int num_ports; 30219820Sjeff unsigned int ports_from_cmdline; 31219820Sjeff u_short ports[MAX_PORTS]; /* Port number to listen on. */ 32219820Sjeff char *listen_addr; /* Address on which the server listens. */ 33219820Sjeff struct addrinfo *listen_addrs; /* Addresses on which the server listens. */ 34219820Sjeff char *host_key_file; /* File containing host key. */ 35219820Sjeff int server_key_bits;/* Size of the server key. */ 36219820Sjeff int login_grace_time; /* Disconnect if no auth in this time 37219820Sjeff * (sec). */ 38219820Sjeff int key_regeneration_time; /* Server key lifetime (seconds). */ 39219820Sjeff int permit_root_login; /* If true, permit root login. */ 40219820Sjeff int ignore_rhosts; /* Ignore .rhosts and .shosts. */ 41219820Sjeff int ignore_user_known_hosts; /* Ignore ~/.ssh/known_hosts 42219820Sjeff * for RhostsRsaAuth */ 43219820Sjeff int print_motd; /* If true, print /etc/motd. */ 44219820Sjeff int check_mail; /* If true, check for new mail. */ 45219820Sjeff int x11_forwarding; /* If true, permit inet (spoofing) X11 fwd. */ 46219820Sjeff int x11_display_offset; /* What DISPLAY number to start 47219820Sjeff * searching at */ 48219820Sjeff int strict_modes; /* If true, require string home dir modes. */ 49219820Sjeff int keepalives; /* If true, set SO_KEEPALIVE. */ 50219820Sjeff SyslogFacility log_facility; /* Facility for system logging. */ 51219820Sjeff LogLevel log_level; /* Level for system logging. */ 52219820Sjeff int rhosts_authentication; /* If true, permit rhosts 53219820Sjeff * authentication. */ 54219820Sjeff int rhosts_rsa_authentication; /* If true, permit rhosts RSA 55219820Sjeff * authentication. */ 56219820Sjeff int rsa_authentication; /* If true, permit RSA authentication. */ 57219820Sjeff#ifdef KRB4 58219820Sjeff int kerberos_authentication; /* If true, permit Kerberos 59219820Sjeff * authentication. */ 60219820Sjeff int kerberos_or_local_passwd; /* If true, permit kerberos 61219820Sjeff * and any other password 62219820Sjeff * authentication mechanism, 63219820Sjeff * such as SecurID or 64219820Sjeff * /etc/passwd */ 65219820Sjeff int kerberos_ticket_cleanup; /* If true, destroy ticket 66219820Sjeff * file on logout. */ 67219820Sjeff#endif 68219820Sjeff#ifdef AFS 69219820Sjeff int kerberos_tgt_passing; /* If true, permit Kerberos tgt 70219820Sjeff * passing. */ 71219820Sjeff int afs_token_passing; /* If true, permit AFS token passing. */ 72219820Sjeff#endif 73219820Sjeff int password_authentication; /* If true, permit password 74219820Sjeff * authentication. */ 75219820Sjeff#ifdef SKEY 76219820Sjeff int skey_authentication; /* If true, permit s/key 77219820Sjeff * authentication. */ 78219820Sjeff#endif 79219820Sjeff int permit_empty_passwd; /* If false, do not permit empty 80219820Sjeff * passwords. */ 81219820Sjeff int use_login; /* If true, login(1) is used */ 82219820Sjeff unsigned int num_allow_users; 83219820Sjeff char *allow_users[MAX_ALLOW_USERS]; 84219820Sjeff unsigned int num_deny_users; 85219820Sjeff char *deny_users[MAX_DENY_USERS]; 86219820Sjeff unsigned int num_allow_groups; 87219820Sjeff char *allow_groups[MAX_ALLOW_GROUPS]; 88219820Sjeff unsigned int num_deny_groups; 89219820Sjeff char *deny_groups[MAX_DENY_GROUPS]; 90219820Sjeff} ServerOptions; 91219820Sjeff/* 92219820Sjeff * Initializes the server options to special values that indicate that they 93219820Sjeff * have not yet been set. 94219820Sjeff */ 95219820Sjeffvoid initialize_server_options(ServerOptions * options); 96219820Sjeff 97219820Sjeff/* 98219820Sjeff * Reads the server configuration file. This only sets the values for those 99219820Sjeff * options that have the special value indicating they have not been set. 100219820Sjeff */ 101219820Sjeffvoid read_server_config(ServerOptions * options, const char *filename); 102219820Sjeff 103219820Sjeff/* Sets values for those values that have not yet been set. */ 104219820Sjeffvoid fill_default_server_options(ServerOptions * options); 105219820Sjeff 106219820Sjeff#endif /* SERVCONF_H */ 107219820Sjeff