xref: /titanic_44/usr/src/cmd/ssh/include/servconf.h (revision 2b4a78020b9c38d1b95e2f3fefa6d6e4be382d1f)
1 /*
2  * Author: Tatu Ylonen <ylo@cs.hut.fi>
3  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4  *                    All rights reserved
5  * Definitions for server configuration data and for the functions reading it.
6  *
7  * As far as I am concerned, the code I have written for this software
8  * can be used freely for any purpose.  Any derived versions of this
9  * software must be clearly marked as such, and if the derived work is
10  * incompatible with the protocol description in the RFC file, it must be
11  * called by a name other than "ssh" or "Secure Shell".
12  */
13 /*
14  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
15  * Use is subject to license terms.
16  */
17 
18 /*	$OpenBSD: servconf.h,v 1.59 2002/07/30 17:03:55 markus Exp $	*/
19 
20 #ifndef	_SERVCONF_H
21 #define	_SERVCONF_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #define MAX_PORTS		256	/* Max # ports. */
28 
29 #define MAX_ALLOW_USERS		256	/* Max # users on allow list. */
30 #define MAX_DENY_USERS		256	/* Max # users on deny list. */
31 #define MAX_ALLOW_GROUPS	256	/* Max # groups on allow list. */
32 #define MAX_DENY_GROUPS		256	/* Max # groups on deny list. */
33 #define MAX_SUBSYSTEMS		256	/* Max # subsystems. */
34 #define MAX_HOSTKEYS		256	/* Max # hostkeys. */
35 
36 /* permit_root_login */
37 #define	PERMIT_NOT_SET		-1
38 #define	PERMIT_NO		0
39 #define	PERMIT_FORCED_ONLY	1
40 #define	PERMIT_NO_PASSWD	2
41 #define	PERMIT_YES		3
42 
43 typedef struct {
44 	u_int num_ports;
45 	u_int ports_from_cmdline;
46 	u_short ports[MAX_PORTS];	/* Port number to listen on. */
47 	char   *listen_addr;		/* Address on which the server listens. */
48 	struct addrinfo *listen_addrs;	/* Addresses on which the server listens. */
49 	char   *host_key_files[MAX_HOSTKEYS];	/* Files containing host keys. */
50 	int     num_host_key_files;     /* Number of files for host keys. */
51 	char   *pid_file;	/* Where to put our pid */
52 	int     server_key_bits;/* Size of the server key. */
53 	int     login_grace_time;	/* Disconnect if no auth in this time
54 					 * (sec). */
55 	int     key_regeneration_time;	/* Server key lifetime (seconds). */
56 	int     permit_root_login;	/* PERMIT_*, see above */
57 	int     ignore_rhosts;	/* Ignore .rhosts and .shosts. */
58 	int     ignore_user_known_hosts;	/* Ignore ~/.ssh/known_hosts
59 						 * for RhostsRsaAuth */
60 	int     print_motd;	/* If true, print /etc/motd. */
61 	int	print_lastlog;	/* If true, print lastlog */
62 	int     x11_forwarding;	/* If true, permit inet (spoofing) X11 fwd. */
63 	int     x11_display_offset;	/* What DISPLAY number to start
64 					 * searching at */
65 	int     x11_use_localhost;	/* If true, use localhost for fake X11 server. */
66 	char   *xauth_location;	/* Location of xauth program */
67 	int     strict_modes;	/* If true, require string home dir modes. */
68 	int     keepalives;	/* If true, set SO_KEEPALIVE. */
69 	char   *ciphers;	/* Supported SSH2 ciphers. */
70 	char   *macs;		/* Supported SSH2 macs. */
71 	int	protocol;	/* Supported protocol versions. */
72 	int     gateway_ports;	/* If true, allow remote connects to forwarded ports. */
73 	SyslogFacility log_facility;	/* Facility for system logging. */
74 	LogLevel log_level;	/* Level for system logging. */
75 	int     rhosts_authentication;	/* If true, permit rhosts
76 					 * authentication. */
77 	int     rhosts_rsa_authentication;	/* If true, permit rhosts RSA
78 						 * authentication. */
79 	int     hostbased_authentication;	/* If true, permit ssh2 hostbased auth */
80 	int     hostbased_uses_name_from_packet_only; /* experimental */
81 	int     rsa_authentication;	/* If true, permit RSA authentication. */
82 	int     pubkey_authentication;	/* If true, permit ssh2 pubkey authentication. */
83 #ifdef GSSAPI
84 	int     gss_authentication;
85 	int     gss_keyex;
86 	int     gss_store_creds;
87 	int     gss_use_session_ccache;        /* If true, delegated credentials are
88 	                                        * stored in a session specific cache */
89 	int 	gss_cleanup_creds;	       /* If true, destroy cred cache on logout */
90 #endif /* GSSAPI */
91 #if defined(KRB4) || defined(KRB5)
92 	int     kerberos_authentication;	/* If true, permit Kerberos
93 						 * authentication. */
94 	int     kerberos_or_local_passwd;	/* If true, permit kerberos
95 						 * and any other password
96 						 * authentication mechanism,
97 						 * such as SecurID or
98 						 * /etc/passwd */
99 	int     kerberos_ticket_cleanup;	/* If true, destroy ticket
100 						 * file on logout. */
101 #endif
102 #if defined(AFS) || defined(KRB5)
103 	int     kerberos_tgt_passing;	/* If true, permit Kerberos TGT
104 					 * passing. */
105 #endif
106 #ifdef AFS
107 	int     afs_token_passing;	/* If true, permit AFS token passing. */
108 #endif
109 	int     password_authentication;	/* If true, permit password
110 						 * authentication. */
111 	int     kbd_interactive_authentication;	/* If true, permit */
112 	int     challenge_response_authentication;
113 	int     permit_empty_passwd;	/* If false, do not permit empty
114 					 * passwords. */
115 	int     permit_user_env;	/* If true, read ~/.ssh/environment */
116 	int     use_login;	/* If true, login(1) is used */
117 	int     compression;	/* If true, compression is allowed */
118 	int	allow_tcp_forwarding;
119 	u_int num_allow_users;
120 	char   *allow_users[MAX_ALLOW_USERS];
121 	u_int num_deny_users;
122 	char   *deny_users[MAX_DENY_USERS];
123 	u_int num_allow_groups;
124 	char   *allow_groups[MAX_ALLOW_GROUPS];
125 	u_int num_deny_groups;
126 	char   *deny_groups[MAX_DENY_GROUPS];
127 
128 	u_int num_subsystems;
129 	char   *subsystem_name[MAX_SUBSYSTEMS];
130 	char   *subsystem_command[MAX_SUBSYSTEMS];
131 
132 	int	max_startups_begin;
133 	int	max_startups_rate;
134 	int	max_startups;
135 	char   *banner;			/* SSH-2 banner message */
136 	int	verify_reverse_mapping;	/* cross-check ip and dns */
137 	int	client_alive_interval;	/*
138 					 * poke the client this often to
139 					 * see if it's still there
140 					 */
141 	int	client_alive_count_max;	/*
142 					 * If the client is unresponsive
143 					 * for this many intervals above,
144 					 * disconnect the session
145 					 */
146 
147 	char   *authorized_keys_file;	/* File containing public keys */
148 	char   *authorized_keys_file2;
149 
150 	int	pam_authentication_via_kbd_int;
151 
152 	int	max_auth_tries;
153 	int	max_auth_tries_log;
154 
155 	int	max_init_auth_tries;	    /* SUNW: /etc/default/login */
156 	int	max_init_auth_tries_log;    /* SUNW: /etc/default/login */
157 
158 	int	lookup_client_hostnames;
159 	int	use_openssl_engine;
160 
161 }       ServerOptions;
162 
163 void	 initialize_server_options(ServerOptions *);
164 void	 read_server_config(ServerOptions *, const char *);
165 void	 fill_default_server_options(ServerOptions *);
166 int	 process_server_config_line(ServerOptions *, char *, const char *, int);
167 
168 #ifdef __cplusplus
169 }
170 #endif
171 
172 
173 #endif	/* _SERVCONF_H */
174