xref: /freebsd/crypto/openssh/pathnames.h (revision f7167e0e)
1f7167e0eSDag-Erling Smørgrav /* $OpenBSD: pathnames.h,v 1.24 2013/12/06 13:39:49 markus Exp $ */
21e8db6e2SBrian Feldman 
31e8db6e2SBrian Feldman /*
41e8db6e2SBrian Feldman  * Author: Tatu Ylonen <ylo@cs.hut.fi>
51e8db6e2SBrian Feldman  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
61e8db6e2SBrian Feldman  *                    All rights reserved
71e8db6e2SBrian Feldman  *
81e8db6e2SBrian Feldman  * As far as I am concerned, the code I have written for this software
91e8db6e2SBrian Feldman  * can be used freely for any purpose.  Any derived versions of this
101e8db6e2SBrian Feldman  * software must be clearly marked as such, and if the derived work is
111e8db6e2SBrian Feldman  * incompatible with the protocol description in the RFC file, it must be
121e8db6e2SBrian Feldman  * called by a name other than "ssh" or "Secure Shell".
131e8db6e2SBrian Feldman  */
141e8db6e2SBrian Feldman 
15af12a3e7SDag-Erling Smørgrav #define ETCDIR				"/etc"
16989dd127SDag-Erling Smørgrav 
17989dd127SDag-Erling Smørgrav #ifndef SSHDIR
18af12a3e7SDag-Erling Smørgrav #define SSHDIR				ETCDIR "/ssh"
19989dd127SDag-Erling Smørgrav #endif
20989dd127SDag-Erling Smørgrav 
21989dd127SDag-Erling Smørgrav #ifndef _PATH_SSH_PIDDIR
221e8db6e2SBrian Feldman #define _PATH_SSH_PIDDIR		"/var/run"
23989dd127SDag-Erling Smørgrav #endif
241e8db6e2SBrian Feldman 
251e8db6e2SBrian Feldman /*
261e8db6e2SBrian Feldman  * System-wide file containing host keys of known hosts.  This file should be
271e8db6e2SBrian Feldman  * world-readable.
281e8db6e2SBrian Feldman  */
29af12a3e7SDag-Erling Smørgrav #define _PATH_SSH_SYSTEM_HOSTFILE	SSHDIR "/ssh_known_hosts"
30af12a3e7SDag-Erling Smørgrav /* backward compat for protocol 2 */
31af12a3e7SDag-Erling Smørgrav #define _PATH_SSH_SYSTEM_HOSTFILE2	SSHDIR "/ssh_known_hosts2"
321e8db6e2SBrian Feldman 
331e8db6e2SBrian Feldman /*
341e8db6e2SBrian Feldman  * Of these, ssh_host_key must be readable only by root, whereas ssh_config
351e8db6e2SBrian Feldman  * should be world-readable.
361e8db6e2SBrian Feldman  */
37af12a3e7SDag-Erling Smørgrav #define _PATH_SERVER_CONFIG_FILE	SSHDIR "/sshd_config"
38af12a3e7SDag-Erling Smørgrav #define _PATH_HOST_CONFIG_FILE		SSHDIR "/ssh_config"
39af12a3e7SDag-Erling Smørgrav #define _PATH_HOST_KEY_FILE		SSHDIR "/ssh_host_key"
40af12a3e7SDag-Erling Smørgrav #define _PATH_HOST_DSA_KEY_FILE		SSHDIR "/ssh_host_dsa_key"
414a421b63SDag-Erling Smørgrav #define _PATH_HOST_ECDSA_KEY_FILE	SSHDIR "/ssh_host_ecdsa_key"
42f7167e0eSDag-Erling Smørgrav #define _PATH_HOST_ED25519_KEY_FILE	SSHDIR "/ssh_host_ed25519_key"
43af12a3e7SDag-Erling Smørgrav #define _PATH_HOST_RSA_KEY_FILE		SSHDIR "/ssh_host_rsa_key"
44af12a3e7SDag-Erling Smørgrav #define _PATH_DH_MODULI			SSHDIR "/moduli"
45af12a3e7SDag-Erling Smørgrav /* Backwards compatibility */
46af12a3e7SDag-Erling Smørgrav #define _PATH_DH_PRIMES			SSHDIR "/primes"
471e8db6e2SBrian Feldman 
48989dd127SDag-Erling Smørgrav #ifndef _PATH_SSH_PROGRAM
491e8db6e2SBrian Feldman #define _PATH_SSH_PROGRAM		"/usr/bin/ssh"
50989dd127SDag-Erling Smørgrav #endif
511e8db6e2SBrian Feldman 
521e8db6e2SBrian Feldman /*
531e8db6e2SBrian Feldman  * The process id of the daemon listening for connections is saved here to
541e8db6e2SBrian Feldman  * make it easier to kill the correct daemon when necessary.
551e8db6e2SBrian Feldman  */
561e8db6e2SBrian Feldman #define _PATH_SSH_DAEMON_PID_FILE	_PATH_SSH_PIDDIR "/sshd.pid"
571e8db6e2SBrian Feldman 
581e8db6e2SBrian Feldman /*
59cce7d346SDag-Erling Smørgrav  * The directory in user's home directory in which the files reside. The
601e8db6e2SBrian Feldman  * directory should be world-readable (though not all files are).
611e8db6e2SBrian Feldman  */
621e8db6e2SBrian Feldman #define _PATH_SSH_USER_DIR		".ssh"
631e8db6e2SBrian Feldman 
641e8db6e2SBrian Feldman /*
651e8db6e2SBrian Feldman  * Per-user file containing host keys of known hosts.  This file need not be
661e8db6e2SBrian Feldman  * readable by anyone except the user him/herself, though this does not
671e8db6e2SBrian Feldman  * contain anything particularly secret.
681e8db6e2SBrian Feldman  */
69e4a9863fSDag-Erling Smørgrav #define _PATH_SSH_USER_HOSTFILE		"~/" _PATH_SSH_USER_DIR "/known_hosts"
70af12a3e7SDag-Erling Smørgrav /* backward compat for protocol 2 */
71e4a9863fSDag-Erling Smørgrav #define _PATH_SSH_USER_HOSTFILE2	"~/" _PATH_SSH_USER_DIR "/known_hosts2"
721e8db6e2SBrian Feldman 
731e8db6e2SBrian Feldman /*
741e8db6e2SBrian Feldman  * Name of the default file containing client-side authentication key. This
751e8db6e2SBrian Feldman  * file should only be readable by the user him/herself.
761e8db6e2SBrian Feldman  */
77e4a9863fSDag-Erling Smørgrav #define _PATH_SSH_CLIENT_IDENTITY	_PATH_SSH_USER_DIR "/identity"
78e4a9863fSDag-Erling Smørgrav #define _PATH_SSH_CLIENT_ID_DSA		_PATH_SSH_USER_DIR "/id_dsa"
79e4a9863fSDag-Erling Smørgrav #define _PATH_SSH_CLIENT_ID_ECDSA	_PATH_SSH_USER_DIR "/id_ecdsa"
80e4a9863fSDag-Erling Smørgrav #define _PATH_SSH_CLIENT_ID_RSA		_PATH_SSH_USER_DIR "/id_rsa"
81f7167e0eSDag-Erling Smørgrav #define _PATH_SSH_CLIENT_ID_ED25519	_PATH_SSH_USER_DIR "/id_ed25519"
821e8db6e2SBrian Feldman 
831e8db6e2SBrian Feldman /*
84cce7d346SDag-Erling Smørgrav  * Configuration file in user's home directory.  This file need not be
851e8db6e2SBrian Feldman  * readable by anyone but the user him/herself, but does not contain anything
86cce7d346SDag-Erling Smørgrav  * particularly secret.  If the user's home directory resides on an NFS
871e8db6e2SBrian Feldman  * volume where root is mapped to nobody, this may need to be world-readable.
881e8db6e2SBrian Feldman  */
89e4a9863fSDag-Erling Smørgrav #define _PATH_SSH_USER_CONFFILE		_PATH_SSH_USER_DIR "/config"
901e8db6e2SBrian Feldman 
911e8db6e2SBrian Feldman /*
921e8db6e2SBrian Feldman  * File containing a list of those rsa keys that permit logging in as this
931e8db6e2SBrian Feldman  * user.  This file need not be readable by anyone but the user him/herself,
94cce7d346SDag-Erling Smørgrav  * but does not contain anything particularly secret.  If the user's home
951e8db6e2SBrian Feldman  * directory resides on an NFS volume where root is mapped to nobody, this
961e8db6e2SBrian Feldman  * may need to be world-readable.  (This file is read by the daemon which is
971e8db6e2SBrian Feldman  * running as root.)
981e8db6e2SBrian Feldman  */
99e4a9863fSDag-Erling Smørgrav #define _PATH_SSH_USER_PERMITTED_KEYS	_PATH_SSH_USER_DIR "/authorized_keys"
100af12a3e7SDag-Erling Smørgrav 
101af12a3e7SDag-Erling Smørgrav /* backward compat for protocol v2 */
102e4a9863fSDag-Erling Smørgrav #define _PATH_SSH_USER_PERMITTED_KEYS2	_PATH_SSH_USER_DIR "/authorized_keys2"
1031e8db6e2SBrian Feldman 
1041e8db6e2SBrian Feldman /*
1051e8db6e2SBrian Feldman  * Per-user and system-wide ssh "rc" files.  These files are executed with
1061e8db6e2SBrian Feldman  * /bin/sh before starting the shell or command if they exist.  They will be
1071e8db6e2SBrian Feldman  * passed "proto cookie" as arguments if X11 forwarding with spoofing is in
1081e8db6e2SBrian Feldman  * use.  xauth will be run if neither of these exists.
1091e8db6e2SBrian Feldman  */
110e4a9863fSDag-Erling Smørgrav #define _PATH_SSH_USER_RC		_PATH_SSH_USER_DIR "/rc"
111af12a3e7SDag-Erling Smørgrav #define _PATH_SSH_SYSTEM_RC		SSHDIR "/sshrc"
1121e8db6e2SBrian Feldman 
1131e8db6e2SBrian Feldman /*
1141e8db6e2SBrian Feldman  * Ssh-only version of /etc/hosts.equiv.  Additionally, the daemon may use
1151e8db6e2SBrian Feldman  * ~/.rhosts and /etc/hosts.equiv if rhosts authentication is enabled.
1161e8db6e2SBrian Feldman  */
117af12a3e7SDag-Erling Smørgrav #define _PATH_SSH_HOSTS_EQUIV		SSHDIR "/shosts.equiv"
1181e8db6e2SBrian Feldman #define _PATH_RHOSTS_EQUIV		"/etc/hosts.equiv"
1191e8db6e2SBrian Feldman 
1201e8db6e2SBrian Feldman /*
1211e8db6e2SBrian Feldman  * Default location of askpass
1221e8db6e2SBrian Feldman  */
123989dd127SDag-Erling Smørgrav #ifndef _PATH_SSH_ASKPASS_DEFAULT
124ffea3f5aSDag-Erling Smørgrav #define _PATH_SSH_ASKPASS_DEFAULT	"/usr/local/bin/ssh-askpass"
125989dd127SDag-Erling Smørgrav #endif
1261e8db6e2SBrian Feldman 
12780628bacSDag-Erling Smørgrav /* Location of ssh-keysign for hostbased authentication */
128989dd127SDag-Erling Smørgrav #ifndef _PATH_SSH_KEY_SIGN
12980628bacSDag-Erling Smørgrav #define _PATH_SSH_KEY_SIGN		"/usr/libexec/ssh-keysign"
130989dd127SDag-Erling Smørgrav #endif
13180628bacSDag-Erling Smørgrav 
132b15c8340SDag-Erling Smørgrav /* Location of ssh-pkcs11-helper to support keys in tokens */
133b15c8340SDag-Erling Smørgrav #ifndef _PATH_SSH_PKCS11_HELPER
134b15c8340SDag-Erling Smørgrav #define _PATH_SSH_PKCS11_HELPER		"/usr/libexec/ssh-pkcs11-helper"
135b15c8340SDag-Erling Smørgrav #endif
136b15c8340SDag-Erling Smørgrav 
137af12a3e7SDag-Erling Smørgrav /* xauth for X11 forwarding */
138989dd127SDag-Erling Smørgrav #ifndef _PATH_XAUTH
139ffea3f5aSDag-Erling Smørgrav #define _PATH_XAUTH			"/usr/local/bin/xauth"
140989dd127SDag-Erling Smørgrav #endif
141af12a3e7SDag-Erling Smørgrav 
142af12a3e7SDag-Erling Smørgrav /* UNIX domain socket for X11 server; displaynum will replace %u */
143989dd127SDag-Erling Smørgrav #ifndef _PATH_UNIX_X
144af12a3e7SDag-Erling Smørgrav #define _PATH_UNIX_X "/tmp/.X11-unix/X%u"
145989dd127SDag-Erling Smørgrav #endif
146989dd127SDag-Erling Smørgrav 
147989dd127SDag-Erling Smørgrav /* for scp */
148989dd127SDag-Erling Smørgrav #ifndef _PATH_CP
149989dd127SDag-Erling Smørgrav #define _PATH_CP			"cp"
150989dd127SDag-Erling Smørgrav #endif
151af12a3e7SDag-Erling Smørgrav 
1521e8db6e2SBrian Feldman /* for sftp */
153989dd127SDag-Erling Smørgrav #ifndef _PATH_SFTP_SERVER
1541e8db6e2SBrian Feldman #define _PATH_SFTP_SERVER		"/usr/libexec/sftp-server"
155989dd127SDag-Erling Smørgrav #endif
15680628bacSDag-Erling Smørgrav 
15780628bacSDag-Erling Smørgrav /* chroot directory for unprivileged user when UsePrivilegeSeparation=yes */
158989dd127SDag-Erling Smørgrav #ifndef _PATH_PRIVSEP_CHROOT_DIR
15980628bacSDag-Erling Smørgrav #define _PATH_PRIVSEP_CHROOT_DIR	"/var/empty"
160989dd127SDag-Erling Smørgrav #endif
161989dd127SDag-Erling Smørgrav 
1621ec0d754SDag-Erling Smørgrav /* for passwd change */
1631ec0d754SDag-Erling Smørgrav #ifndef _PATH_PASSWD_PROG
1641ec0d754SDag-Erling Smørgrav #define _PATH_PASSWD_PROG             "/usr/bin/passwd"
1651ec0d754SDag-Erling Smørgrav #endif
1661ec0d754SDag-Erling Smørgrav 
167989dd127SDag-Erling Smørgrav #ifndef _PATH_LS
168989dd127SDag-Erling Smørgrav #define _PATH_LS			"ls"
169989dd127SDag-Erling Smørgrav #endif
170989dd127SDag-Erling Smørgrav 
171989dd127SDag-Erling Smørgrav /* path to login program */
172989dd127SDag-Erling Smørgrav #ifndef LOGIN_PROGRAM
173989dd127SDag-Erling Smørgrav # ifdef LOGIN_PROGRAM_FALLBACK
174989dd127SDag-Erling Smørgrav #  define LOGIN_PROGRAM         LOGIN_PROGRAM_FALLBACK
175989dd127SDag-Erling Smørgrav # else
176989dd127SDag-Erling Smørgrav #  define LOGIN_PROGRAM         "/usr/bin/login"
177989dd127SDag-Erling Smørgrav # endif
178989dd127SDag-Erling Smørgrav #endif /* LOGIN_PROGRAM */
179989dd127SDag-Erling Smørgrav 
180989dd127SDag-Erling Smørgrav /* Askpass program define */
181989dd127SDag-Erling Smørgrav #ifndef ASKPASS_PROGRAM
182989dd127SDag-Erling Smørgrav #define ASKPASS_PROGRAM         "/usr/lib/ssh/ssh-askpass"
183989dd127SDag-Erling Smørgrav #endif /* ASKPASS_PROGRAM */
184