1231984Sjilles/* $OpenBSD: pathnames.h,v 1.31 2019/11/12 19:33:08 markus Exp $ */ 2231984Sjilles 3231984Sjilles/* 4231984Sjilles * Author: Tatu Ylonen <ylo@cs.hut.fi> 5231984Sjilles * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 6231984Sjilles * All rights reserved 7231984Sjilles * 8231984Sjilles * As far as I am concerned, the code I have written for this software 9231984Sjilles * can be used freely for any purpose. Any derived versions of this 10231984Sjilles * software must be clearly marked as such, and if the derived work is 11231984Sjilles * incompatible with the protocol description in the RFC file, it must be 12231984Sjilles * called by a name other than "ssh" or "Secure Shell". 13231984Sjilles */ 14231984Sjilles 15231984Sjilles#define ETCDIR "/etc" 16231984Sjilles 17231984Sjilles#ifndef SSHDIR 18231984Sjilles#define SSHDIR ETCDIR "/ssh" 19231984Sjilles#endif 20231984Sjilles 21231984Sjilles#ifndef _PATH_SSH_PIDDIR 22231984Sjilles#define _PATH_SSH_PIDDIR "/var/run" 23231984Sjilles#endif 24231984Sjilles 25231984Sjilles/* 26231984Sjilles * System-wide file containing host keys of known hosts. This file should be 27231984Sjilles * world-readable. 28231984Sjilles */ 29231984Sjilles#define _PATH_SSH_SYSTEM_HOSTFILE SSHDIR "/ssh_known_hosts" 30290572Sngie/* backward compat for protocol 2 */ 31231984Sjilles#define _PATH_SSH_SYSTEM_HOSTFILE2 SSHDIR "/ssh_known_hosts2" 32231984Sjilles 33231984Sjilles/* 34231984Sjilles * Of these, ssh_host_key must be readable only by root, whereas ssh_config 35231984Sjilles * should be world-readable. 36231984Sjilles */ 37231984Sjilles#define _PATH_SERVER_CONFIG_FILE SSHDIR "/sshd_config" 38231984Sjilles#define _PATH_HOST_CONFIG_FILE SSHDIR "/ssh_config" 39231984Sjilles#define _PATH_HOST_DSA_KEY_FILE SSHDIR "/ssh_host_dsa_key" 40290572Sngie#define _PATH_HOST_ECDSA_KEY_FILE SSHDIR "/ssh_host_ecdsa_key" 41290572Sngie#define _PATH_HOST_ED25519_KEY_FILE SSHDIR "/ssh_host_ed25519_key" 42231984Sjilles#define _PATH_HOST_XMSS_KEY_FILE SSHDIR "/ssh_host_xmss_key" 43231984Sjilles#define _PATH_HOST_RSA_KEY_FILE SSHDIR "/ssh_host_rsa_key" 44231984Sjilles#define _PATH_DH_MODULI SSHDIR "/moduli" 45231984Sjilles 46231984Sjilles#ifndef _PATH_SSH_PROGRAM 47231984Sjilles#define _PATH_SSH_PROGRAM "/usr/bin/ssh" 48231984Sjilles#endif 49231984Sjilles 50231984Sjilles/* 51231984Sjilles * The process id of the daemon listening for connections is saved here to 52231984Sjilles * make it easier to kill the correct daemon when necessary. 53231984Sjilles */ 54231984Sjilles#define _PATH_SSH_DAEMON_PID_FILE _PATH_SSH_PIDDIR "/sshd.pid" 55231984Sjilles 56231984Sjilles/* 57231984Sjilles * The directory in user's home directory in which the files reside. The 58231984Sjilles * directory should be world-readable (though not all files are). 59231984Sjilles */ 60231984Sjilles#define _PATH_SSH_USER_DIR ".ssh" 61231984Sjilles 62231984Sjilles/* 63231984Sjilles * Per-user file containing host keys of known hosts. This file need not be 64231984Sjilles * readable by anyone except the user him/herself, though this does not 65231984Sjilles * contain anything particularly secret. 66231984Sjilles */ 67231984Sjilles#define _PATH_SSH_USER_HOSTFILE "~/" _PATH_SSH_USER_DIR "/known_hosts" 68231984Sjilles/* backward compat for protocol 2 */ 69231984Sjilles#define _PATH_SSH_USER_HOSTFILE2 "~/" _PATH_SSH_USER_DIR "/known_hosts2" 70231984Sjilles 71231984Sjilles/* 72231984Sjilles * Name of the default file containing client-side authentication key. This 73231984Sjilles * file should only be readable by the user him/herself. 74231984Sjilles */ 75231984Sjilles#define _PATH_SSH_CLIENT_ID_DSA _PATH_SSH_USER_DIR "/id_dsa" 76231984Sjilles#define _PATH_SSH_CLIENT_ID_ECDSA _PATH_SSH_USER_DIR "/id_ecdsa" 77231984Sjilles#define _PATH_SSH_CLIENT_ID_RSA _PATH_SSH_USER_DIR "/id_rsa" 78231984Sjilles#define _PATH_SSH_CLIENT_ID_ED25519 _PATH_SSH_USER_DIR "/id_ed25519" 79231984Sjilles#define _PATH_SSH_CLIENT_ID_XMSS _PATH_SSH_USER_DIR "/id_xmss" 80231984Sjilles#define _PATH_SSH_CLIENT_ID_ECDSA_SK _PATH_SSH_USER_DIR "/id_ecdsa_sk" 81231984Sjilles#define _PATH_SSH_CLIENT_ID_ED25519_SK _PATH_SSH_USER_DIR "/id_ed25519_sk" 82231984Sjilles 83231984Sjilles/* 84231984Sjilles * Configuration file in user's home directory. This file need not be 85231984Sjilles * readable by anyone but the user him/herself, but does not contain anything 86231984Sjilles * particularly secret. If the user's home directory resides on an NFS 87231984Sjilles * volume where root is mapped to nobody, this may need to be world-readable. 88231984Sjilles */ 89231984Sjilles#define _PATH_SSH_USER_CONFFILE _PATH_SSH_USER_DIR "/config" 90231984Sjilles 91231984Sjilles/* 92231984Sjilles * File containing a list of those rsa keys that permit logging in as this 93231984Sjilles * user. This file need not be readable by anyone but the user him/herself, 94231984Sjilles * but does not contain anything particularly secret. If the user's home 95231984Sjilles * directory resides on an NFS volume where root is mapped to nobody, this 96231984Sjilles * may need to be world-readable. (This file is read by the daemon which is 97231984Sjilles * running as root.) 98231984Sjilles */ 99231984Sjilles#define _PATH_SSH_USER_PERMITTED_KEYS _PATH_SSH_USER_DIR "/authorized_keys" 100231984Sjilles 101231984Sjilles/* backward compat for protocol v2 */ 102231984Sjilles#define _PATH_SSH_USER_PERMITTED_KEYS2 _PATH_SSH_USER_DIR "/authorized_keys2" 103231984Sjilles 104231984Sjilles/* 105231984Sjilles * Per-user and system-wide ssh "rc" files. These files are executed with 106231984Sjilles * /bin/sh before starting the shell or command if they exist. They will be 107231984Sjilles * passed "proto cookie" as arguments if X11 forwarding with spoofing is in 108231984Sjilles * use. xauth will be run if neither of these exists. 109231984Sjilles */ 110231984Sjilles#define _PATH_SSH_USER_RC _PATH_SSH_USER_DIR "/rc" 111231984Sjilles#define _PATH_SSH_SYSTEM_RC SSHDIR "/sshrc" 112231984Sjilles 113231984Sjilles/* 114231984Sjilles * Ssh-only version of /etc/hosts.equiv. Additionally, the daemon may use 115231984Sjilles * ~/.rhosts and /etc/hosts.equiv if rhosts authentication is enabled. 116231984Sjilles */ 117231984Sjilles#define _PATH_SSH_HOSTS_EQUIV SSHDIR "/shosts.equiv" 118231984Sjilles#define _PATH_RHOSTS_EQUIV "/etc/hosts.equiv" 119231984Sjilles 120231984Sjilles/* 121231984Sjilles * Default location of askpass 122231984Sjilles */ 123231984Sjilles#ifndef _PATH_SSH_ASKPASS_DEFAULT 124231984Sjilles#define _PATH_SSH_ASKPASS_DEFAULT "/usr/local/bin/ssh-askpass" 125231984Sjilles#endif 126231984Sjilles 127231984Sjilles/* Location of ssh-keysign for hostbased authentication */ 128231984Sjilles#ifndef _PATH_SSH_KEY_SIGN 129231984Sjilles#define _PATH_SSH_KEY_SIGN "/usr/libexec/ssh-keysign" 130231984Sjilles#endif 131231984Sjilles 132231984Sjilles/* Location of ssh-pkcs11-helper to support keys in tokens */ 133231984Sjilles#ifndef _PATH_SSH_PKCS11_HELPER 134231984Sjilles#define _PATH_SSH_PKCS11_HELPER "/usr/libexec/ssh-pkcs11-helper" 135231984Sjilles#endif 136231984Sjilles 137231984Sjilles/* Location of ssh-sk-helper to support keys in security keys */ 138231984Sjilles#ifndef _PATH_SSH_SK_HELPER 139231984Sjilles#define _PATH_SSH_SK_HELPER "/usr/libexec/ssh-sk-helper" 140231984Sjilles#endif 141231984Sjilles 142231984Sjilles/* xauth for X11 forwarding */ 143231984Sjilles#ifndef _PATH_XAUTH 144231984Sjilles#define _PATH_XAUTH "/usr/local/bin/xauth" 145231984Sjilles#endif 146231984Sjilles 147231984Sjilles/* UNIX domain socket for X11 server; displaynum will replace %u */ 148231984Sjilles#ifndef _PATH_UNIX_X 149231984Sjilles#define _PATH_UNIX_X "/tmp/.X11-unix/X%u" 150231984Sjilles#endif 151231984Sjilles 152231984Sjilles/* for scp */ 153231984Sjilles#ifndef _PATH_CP 154231984Sjilles#define _PATH_CP "cp" 155231984Sjilles#endif 156231984Sjilles 157231984Sjilles/* for sftp */ 158231984Sjilles#ifndef _PATH_SFTP_SERVER 159231984Sjilles#define _PATH_SFTP_SERVER "/usr/libexec/sftp-server" 160231984Sjilles#endif 161231984Sjilles 162231984Sjilles/* chroot directory for unprivileged user when UsePrivilegeSeparation=yes */ 163231984Sjilles#ifndef _PATH_PRIVSEP_CHROOT_DIR 164231984Sjilles#define _PATH_PRIVSEP_CHROOT_DIR "/var/empty" 165231984Sjilles#endif 166231984Sjilles 167231984Sjilles/* for passwd change */ 168231984Sjilles#ifndef _PATH_PASSWD_PROG 169231984Sjilles#define _PATH_PASSWD_PROG "/usr/bin/passwd" 170231984Sjilles#endif 171231984Sjilles 172231984Sjilles#ifndef _PATH_LS 173231984Sjilles#define _PATH_LS "ls" 174231984Sjilles#endif 175231984Sjilles 176231984Sjilles/* Askpass program define */ 177231984Sjilles#ifndef ASKPASS_PROGRAM 178231984Sjilles#define ASKPASS_PROGRAM "/usr/lib/ssh/ssh-askpass" 179231984Sjilles#endif /* ASKPASS_PROGRAM */ 180231984Sjilles