xref: /openssh-portable/pathnames.h (revision 2c55744a)
1*2c55744aSmarkus@openbsd.org /* $OpenBSD: pathnames.h,v 1.31 2019/11/12 19:33:08 markus Exp $ */
236579d3dSBen Lindstrom 
3226cfa03SBen Lindstrom /*
4226cfa03SBen Lindstrom  * Author: Tatu Ylonen <ylo@cs.hut.fi>
5226cfa03SBen Lindstrom  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
6226cfa03SBen Lindstrom  *                    All rights reserved
7226cfa03SBen Lindstrom  *
8226cfa03SBen Lindstrom  * As far as I am concerned, the code I have written for this software
9226cfa03SBen Lindstrom  * can be used freely for any purpose.  Any derived versions of this
10226cfa03SBen Lindstrom  * software must be clearly marked as such, and if the derived work is
11226cfa03SBen Lindstrom  * incompatible with the protocol description in the RFC file, it must be
12226cfa03SBen Lindstrom  * called by a name other than "ssh" or "Secure Shell".
13226cfa03SBen Lindstrom  */
14226cfa03SBen Lindstrom 
15226cfa03SBen Lindstrom #define ETCDIR				"/etc"
1605eda437SDamien Miller 
1705eda437SDamien Miller #ifndef SSHDIR
1805eda437SDamien Miller #define SSHDIR				ETCDIR "/ssh"
19226cfa03SBen Lindstrom #endif
20226cfa03SBen Lindstrom 
21226cfa03SBen Lindstrom #ifndef _PATH_SSH_PIDDIR
22226cfa03SBen Lindstrom #define _PATH_SSH_PIDDIR		"/var/run"
23226cfa03SBen Lindstrom #endif
24226cfa03SBen Lindstrom 
25226cfa03SBen Lindstrom /*
26226cfa03SBen Lindstrom  * System-wide file containing host keys of known hosts.  This file should be
27226cfa03SBen Lindstrom  * world-readable.
28226cfa03SBen Lindstrom  */
2905eda437SDamien Miller #define _PATH_SSH_SYSTEM_HOSTFILE	SSHDIR "/ssh_known_hosts"
30d6481ea4SBen Lindstrom /* backward compat for protocol 2 */
3105eda437SDamien Miller #define _PATH_SSH_SYSTEM_HOSTFILE2	SSHDIR "/ssh_known_hosts2"
32226cfa03SBen Lindstrom 
33226cfa03SBen Lindstrom /*
34226cfa03SBen Lindstrom  * Of these, ssh_host_key must be readable only by root, whereas ssh_config
35226cfa03SBen Lindstrom  * should be world-readable.
36226cfa03SBen Lindstrom  */
3705eda437SDamien Miller #define _PATH_SERVER_CONFIG_FILE	SSHDIR "/sshd_config"
3805eda437SDamien Miller #define _PATH_HOST_CONFIG_FILE		SSHDIR "/ssh_config"
3905eda437SDamien Miller #define _PATH_HOST_DSA_KEY_FILE		SSHDIR "/ssh_host_dsa_key"
40eb8b60e3SDamien Miller #define _PATH_HOST_ECDSA_KEY_FILE	SSHDIR "/ssh_host_ecdsa_key"
415be9d9e3SDamien Miller #define _PATH_HOST_ED25519_KEY_FILE	SSHDIR "/ssh_host_ed25519_key"
421b11ea7cSmarkus@openbsd.org #define _PATH_HOST_XMSS_KEY_FILE	SSHDIR "/ssh_host_xmss_key"
4305eda437SDamien Miller #define _PATH_HOST_RSA_KEY_FILE		SSHDIR "/ssh_host_rsa_key"
4405eda437SDamien Miller #define _PATH_DH_MODULI			SSHDIR "/moduli"
45226cfa03SBen Lindstrom 
4627eebe6cSBen Lindstrom #ifndef _PATH_SSH_PROGRAM
47226cfa03SBen Lindstrom #define _PATH_SSH_PROGRAM		"/usr/bin/ssh"
4827eebe6cSBen Lindstrom #endif
49226cfa03SBen Lindstrom 
50226cfa03SBen Lindstrom /*
51226cfa03SBen Lindstrom  * The process id of the daemon listening for connections is saved here to
52226cfa03SBen Lindstrom  * make it easier to kill the correct daemon when necessary.
53226cfa03SBen Lindstrom  */
54226cfa03SBen Lindstrom #define _PATH_SSH_DAEMON_PID_FILE	_PATH_SSH_PIDDIR "/sshd.pid"
55226cfa03SBen Lindstrom 
56226cfa03SBen Lindstrom /*
57a70ac76aSDamien Miller  * The directory in user's home directory in which the files reside. The
58226cfa03SBen Lindstrom  * directory should be world-readable (though not all files are).
59226cfa03SBen Lindstrom  */
60226cfa03SBen Lindstrom #define _PATH_SSH_USER_DIR		".ssh"
61226cfa03SBen Lindstrom 
62226cfa03SBen Lindstrom /*
63226cfa03SBen Lindstrom  * Per-user file containing host keys of known hosts.  This file need not be
64226cfa03SBen Lindstrom  * readable by anyone except the user him/herself, though this does not
65226cfa03SBen Lindstrom  * contain anything particularly secret.
66226cfa03SBen Lindstrom  */
679f12b5dcSDamien Miller #define _PATH_SSH_USER_HOSTFILE		"~/" _PATH_SSH_USER_DIR "/known_hosts"
68d6481ea4SBen Lindstrom /* backward compat for protocol 2 */
699f12b5dcSDamien Miller #define _PATH_SSH_USER_HOSTFILE2	"~/" _PATH_SSH_USER_DIR "/known_hosts2"
70226cfa03SBen Lindstrom 
71226cfa03SBen Lindstrom /*
72226cfa03SBen Lindstrom  * Name of the default file containing client-side authentication key. This
73226cfa03SBen Lindstrom  * file should only be readable by the user him/herself.
74226cfa03SBen Lindstrom  */
759f12b5dcSDamien Miller #define _PATH_SSH_CLIENT_ID_DSA		_PATH_SSH_USER_DIR "/id_dsa"
769f12b5dcSDamien Miller #define _PATH_SSH_CLIENT_ID_ECDSA	_PATH_SSH_USER_DIR "/id_ecdsa"
779f12b5dcSDamien Miller #define _PATH_SSH_CLIENT_ID_RSA		_PATH_SSH_USER_DIR "/id_rsa"
785be9d9e3SDamien Miller #define _PATH_SSH_CLIENT_ID_ED25519	_PATH_SSH_USER_DIR "/id_ed25519"
791b11ea7cSmarkus@openbsd.org #define _PATH_SSH_CLIENT_ID_XMSS	_PATH_SSH_USER_DIR "/id_xmss"
8002bb0768Sdjm@openbsd.org #define _PATH_SSH_CLIENT_ID_ECDSA_SK	_PATH_SSH_USER_DIR "/id_ecdsa_sk"
81*2c55744aSmarkus@openbsd.org #define _PATH_SSH_CLIENT_ID_ED25519_SK	_PATH_SSH_USER_DIR "/id_ed25519_sk"
82226cfa03SBen Lindstrom 
83226cfa03SBen Lindstrom /*
84a70ac76aSDamien Miller  * Configuration file in user's home directory.  This file need not be
85226cfa03SBen Lindstrom  * readable by anyone but the user him/herself, but does not contain anything
86a70ac76aSDamien Miller  * particularly secret.  If the user's home directory resides on an NFS
87226cfa03SBen Lindstrom  * volume where root is mapped to nobody, this may need to be world-readable.
88226cfa03SBen Lindstrom  */
899f12b5dcSDamien Miller #define _PATH_SSH_USER_CONFFILE		_PATH_SSH_USER_DIR "/config"
90226cfa03SBen Lindstrom 
91226cfa03SBen Lindstrom /*
92226cfa03SBen Lindstrom  * File containing a list of those rsa keys that permit logging in as this
93226cfa03SBen Lindstrom  * user.  This file need not be readable by anyone but the user him/herself,
94a70ac76aSDamien Miller  * but does not contain anything particularly secret.  If the user's home
95226cfa03SBen Lindstrom  * directory resides on an NFS volume where root is mapped to nobody, this
96226cfa03SBen Lindstrom  * may need to be world-readable.  (This file is read by the daemon which is
97226cfa03SBen Lindstrom  * running as root.)
98226cfa03SBen Lindstrom  */
999f12b5dcSDamien Miller #define _PATH_SSH_USER_PERMITTED_KEYS	_PATH_SSH_USER_DIR "/authorized_keys"
100f96704d4SBen Lindstrom 
101d8478b6aSDamien Miller /* backward compat for protocol v2 */
1029f12b5dcSDamien Miller #define _PATH_SSH_USER_PERMITTED_KEYS2	_PATH_SSH_USER_DIR "/authorized_keys2"
103d8478b6aSDamien Miller 
104226cfa03SBen Lindstrom /*
105226cfa03SBen Lindstrom  * Per-user and system-wide ssh "rc" files.  These files are executed with
106226cfa03SBen Lindstrom  * /bin/sh before starting the shell or command if they exist.  They will be
107226cfa03SBen Lindstrom  * passed "proto cookie" as arguments if X11 forwarding with spoofing is in
108226cfa03SBen Lindstrom  * use.  xauth will be run if neither of these exists.
109226cfa03SBen Lindstrom  */
1109f12b5dcSDamien Miller #define _PATH_SSH_USER_RC		_PATH_SSH_USER_DIR "/rc"
11105eda437SDamien Miller #define _PATH_SSH_SYSTEM_RC		SSHDIR "/sshrc"
112226cfa03SBen Lindstrom 
113226cfa03SBen Lindstrom /*
114226cfa03SBen Lindstrom  * Ssh-only version of /etc/hosts.equiv.  Additionally, the daemon may use
115226cfa03SBen Lindstrom  * ~/.rhosts and /etc/hosts.equiv if rhosts authentication is enabled.
116226cfa03SBen Lindstrom  */
11705eda437SDamien Miller #define _PATH_SSH_HOSTS_EQUIV		SSHDIR "/shosts.equiv"
118226cfa03SBen Lindstrom #define _PATH_RHOSTS_EQUIV		"/etc/hosts.equiv"
119226cfa03SBen Lindstrom 
120226cfa03SBen Lindstrom /*
121226cfa03SBen Lindstrom  * Default location of askpass
122226cfa03SBen Lindstrom  */
123cb577331SBen Lindstrom #ifndef _PATH_SSH_ASKPASS_DEFAULT
124226cfa03SBen Lindstrom #define _PATH_SSH_ASKPASS_DEFAULT	"/usr/X11R6/bin/ssh-askpass"
125cb577331SBen Lindstrom #endif
126226cfa03SBen Lindstrom 
1271bad2568SBen Lindstrom /* Location of ssh-keysign for hostbased authentication */
1281bad2568SBen Lindstrom #ifndef _PATH_SSH_KEY_SIGN
1291bad2568SBen Lindstrom #define _PATH_SSH_KEY_SIGN		"/usr/libexec/ssh-keysign"
1301bad2568SBen Lindstrom #endif
1311bad2568SBen Lindstrom 
132a80f1404SDamien Miller /* Location of ssh-pkcs11-helper to support keys in tokens */
1337ea845e4SDamien Miller #ifndef _PATH_SSH_PKCS11_HELPER
1347ea845e4SDamien Miller #define _PATH_SSH_PKCS11_HELPER		"/usr/libexec/ssh-pkcs11-helper"
1357ea845e4SDamien Miller #endif
1367ea845e4SDamien Miller 
13707da39f7Sdjm@openbsd.org /* Location of ssh-sk-helper to support keys in security keys */
13807da39f7Sdjm@openbsd.org #ifndef _PATH_SSH_SK_HELPER
13907da39f7Sdjm@openbsd.org #define _PATH_SSH_SK_HELPER		"/usr/libexec/ssh-sk-helper"
14007da39f7Sdjm@openbsd.org #endif
14107da39f7Sdjm@openbsd.org 
14237a777e9SKevin Steves /* xauth for X11 forwarding */
14337a777e9SKevin Steves #ifndef _PATH_XAUTH
14437a777e9SKevin Steves #define _PATH_XAUTH			"/usr/X11R6/bin/xauth"
14537a777e9SKevin Steves #endif
14637a777e9SKevin Steves 
1473afe375fSDamien Miller /* UNIX domain socket for X11 server; displaynum will replace %u */
1483afe375fSDamien Miller #ifndef _PATH_UNIX_X
1493afe375fSDamien Miller #define _PATH_UNIX_X "/tmp/.X11-unix/X%u"
1503afe375fSDamien Miller #endif
1513afe375fSDamien Miller 
152226cfa03SBen Lindstrom /* for scp */
153226cfa03SBen Lindstrom #ifndef _PATH_CP
154226cfa03SBen Lindstrom #define _PATH_CP			"cp"
155226cfa03SBen Lindstrom #endif
156226cfa03SBen Lindstrom 
157d7686fd1SDamien Miller /* for sftp */
158d7686fd1SDamien Miller #ifndef _PATH_SFTP_SERVER
159d7686fd1SDamien Miller #define _PATH_SFTP_SERVER		"/usr/libexec/sftp-server"
160d7686fd1SDamien Miller #endif
1617a7edf77SBen Lindstrom 
1627a7edf77SBen Lindstrom /* chroot directory for unprivileged user when UsePrivilegeSeparation=yes */
163f58c672fSDamien Miller #ifndef _PATH_PRIVSEP_CHROOT_DIR
1647a7edf77SBen Lindstrom #define _PATH_PRIVSEP_CHROOT_DIR	"/var/empty"
165f58c672fSDamien Miller #endif
166f58c672fSDamien Miller 
16723bc8d0bSDarren Tucker /* for passwd change */
16823bc8d0bSDarren Tucker #ifndef _PATH_PASSWD_PROG
16923bc8d0bSDarren Tucker #define _PATH_PASSWD_PROG             "/usr/bin/passwd"
17023bc8d0bSDarren Tucker #endif
17123bc8d0bSDarren Tucker 
172896b88acSDamien Miller #ifndef _PATH_LS
173d7686fd1SDamien Miller #define _PATH_LS			"ls"
174896b88acSDamien Miller #endif
175d7686fd1SDamien Miller 
176226cfa03SBen Lindstrom /* Askpass program define */
177226cfa03SBen Lindstrom #ifndef ASKPASS_PROGRAM
178226cfa03SBen Lindstrom #define ASKPASS_PROGRAM         "/usr/lib/ssh/ssh-askpass"
179226cfa03SBen Lindstrom #endif /* ASKPASS_PROGRAM */
180