119261079SEd Maste /* $OpenBSD: pathnames.h,v 1.31 2019/11/12 19:33:08 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_DSA_KEY_FILE SSHDIR "/ssh_host_dsa_key" 404a421b63SDag-Erling Smørgrav #define _PATH_HOST_ECDSA_KEY_FILE SSHDIR "/ssh_host_ecdsa_key" 41f7167e0eSDag-Erling Smørgrav #define _PATH_HOST_ED25519_KEY_FILE SSHDIR "/ssh_host_ed25519_key" 4247dd1d1bSDag-Erling Smørgrav #define _PATH_HOST_XMSS_KEY_FILE SSHDIR "/ssh_host_xmss_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" 451e8db6e2SBrian Feldman 46989dd127SDag-Erling Smørgrav #ifndef _PATH_SSH_PROGRAM 471e8db6e2SBrian Feldman #define _PATH_SSH_PROGRAM "/usr/bin/ssh" 48989dd127SDag-Erling Smørgrav #endif 491e8db6e2SBrian Feldman 501e8db6e2SBrian Feldman /* 511e8db6e2SBrian Feldman * The process id of the daemon listening for connections is saved here to 521e8db6e2SBrian Feldman * make it easier to kill the correct daemon when necessary. 531e8db6e2SBrian Feldman */ 541e8db6e2SBrian Feldman #define _PATH_SSH_DAEMON_PID_FILE _PATH_SSH_PIDDIR "/sshd.pid" 551e8db6e2SBrian Feldman 561e8db6e2SBrian Feldman /* 57cce7d346SDag-Erling Smørgrav * The directory in user's home directory in which the files reside. The 581e8db6e2SBrian Feldman * directory should be world-readable (though not all files are). 591e8db6e2SBrian Feldman */ 601e8db6e2SBrian Feldman #define _PATH_SSH_USER_DIR ".ssh" 611e8db6e2SBrian Feldman 621e8db6e2SBrian Feldman /* 631e8db6e2SBrian Feldman * Per-user file containing host keys of known hosts. This file need not be 641e8db6e2SBrian Feldman * readable by anyone except the user him/herself, though this does not 651e8db6e2SBrian Feldman * contain anything particularly secret. 661e8db6e2SBrian Feldman */ 67e4a9863fSDag-Erling Smørgrav #define _PATH_SSH_USER_HOSTFILE "~/" _PATH_SSH_USER_DIR "/known_hosts" 68af12a3e7SDag-Erling Smørgrav /* backward compat for protocol 2 */ 69e4a9863fSDag-Erling Smørgrav #define _PATH_SSH_USER_HOSTFILE2 "~/" _PATH_SSH_USER_DIR "/known_hosts2" 701e8db6e2SBrian Feldman 711e8db6e2SBrian Feldman /* 721e8db6e2SBrian Feldman * Name of the default file containing client-side authentication key. This 731e8db6e2SBrian Feldman * file should only be readable by the user him/herself. 741e8db6e2SBrian Feldman */ 75e4a9863fSDag-Erling Smørgrav #define _PATH_SSH_CLIENT_ID_DSA _PATH_SSH_USER_DIR "/id_dsa" 76e4a9863fSDag-Erling Smørgrav #define _PATH_SSH_CLIENT_ID_ECDSA _PATH_SSH_USER_DIR "/id_ecdsa" 77e4a9863fSDag-Erling Smørgrav #define _PATH_SSH_CLIENT_ID_RSA _PATH_SSH_USER_DIR "/id_rsa" 78f7167e0eSDag-Erling Smørgrav #define _PATH_SSH_CLIENT_ID_ED25519 _PATH_SSH_USER_DIR "/id_ed25519" 7947dd1d1bSDag-Erling Smørgrav #define _PATH_SSH_CLIENT_ID_XMSS _PATH_SSH_USER_DIR "/id_xmss" 8019261079SEd Maste #define _PATH_SSH_CLIENT_ID_ECDSA_SK _PATH_SSH_USER_DIR "/id_ecdsa_sk" 8119261079SEd Maste #define _PATH_SSH_CLIENT_ID_ED25519_SK _PATH_SSH_USER_DIR "/id_ed25519_sk" 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 1246dd7775dSDag-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 13719261079SEd Maste /* Location of ssh-sk-helper to support keys in security keys */ 13819261079SEd Maste #ifndef _PATH_SSH_SK_HELPER 13919261079SEd Maste #define _PATH_SSH_SK_HELPER "/usr/libexec/ssh-sk-helper" 14019261079SEd Maste #endif 14119261079SEd Maste 142af12a3e7SDag-Erling Smørgrav /* xauth for X11 forwarding */ 143989dd127SDag-Erling Smørgrav #ifndef _PATH_XAUTH 1446dd7775dSDag-Erling Smørgrav #define _PATH_XAUTH "/usr/local/bin/xauth" 145989dd127SDag-Erling Smørgrav #endif 146af12a3e7SDag-Erling Smørgrav 147af12a3e7SDag-Erling Smørgrav /* UNIX domain socket for X11 server; displaynum will replace %u */ 148989dd127SDag-Erling Smørgrav #ifndef _PATH_UNIX_X 149af12a3e7SDag-Erling Smørgrav #define _PATH_UNIX_X "/tmp/.X11-unix/X%u" 150989dd127SDag-Erling Smørgrav #endif 151989dd127SDag-Erling Smørgrav 152989dd127SDag-Erling Smørgrav /* for scp */ 153989dd127SDag-Erling Smørgrav #ifndef _PATH_CP 154989dd127SDag-Erling Smørgrav #define _PATH_CP "cp" 155989dd127SDag-Erling Smørgrav #endif 156af12a3e7SDag-Erling Smørgrav 1571e8db6e2SBrian Feldman /* for sftp */ 158989dd127SDag-Erling Smørgrav #ifndef _PATH_SFTP_SERVER 1591e8db6e2SBrian Feldman #define _PATH_SFTP_SERVER "/usr/libexec/sftp-server" 160989dd127SDag-Erling Smørgrav #endif 16180628bacSDag-Erling Smørgrav 16280628bacSDag-Erling Smørgrav /* chroot directory for unprivileged user when UsePrivilegeSeparation=yes */ 163989dd127SDag-Erling Smørgrav #ifndef _PATH_PRIVSEP_CHROOT_DIR 16480628bacSDag-Erling Smørgrav #define _PATH_PRIVSEP_CHROOT_DIR "/var/empty" 165989dd127SDag-Erling Smørgrav #endif 166989dd127SDag-Erling Smørgrav 1671ec0d754SDag-Erling Smørgrav /* for passwd change */ 1681ec0d754SDag-Erling Smørgrav #ifndef _PATH_PASSWD_PROG 1691ec0d754SDag-Erling Smørgrav #define _PATH_PASSWD_PROG "/usr/bin/passwd" 1701ec0d754SDag-Erling Smørgrav #endif 1711ec0d754SDag-Erling Smørgrav 172989dd127SDag-Erling Smørgrav #ifndef _PATH_LS 173989dd127SDag-Erling Smørgrav #define _PATH_LS "ls" 174989dd127SDag-Erling Smørgrav #endif 175989dd127SDag-Erling Smørgrav 176989dd127SDag-Erling Smørgrav /* Askpass program define */ 177989dd127SDag-Erling Smørgrav #ifndef ASKPASS_PROGRAM 178989dd127SDag-Erling Smørgrav #define ASKPASS_PROGRAM "/usr/lib/ssh/ssh-askpass" 179989dd127SDag-Erling Smørgrav #endif /* ASKPASS_PROGRAM */ 180