View Javadoc
1   /*
2    * Copyright (C) 2018 Thomas Wolf <thomas.wolf@paranor.ch>
3    * and other copyright owners as documented in the project's IP log.
4    *
5    * This program and the accompanying materials are made available
6    * under the terms of the Eclipse Distribution License v1.0 which
7    * accompanies this distribution, is reproduced below, and is
8    * available at http://www.eclipse.org/org/documents/edl-v10.php
9    *
10   * All rights reserved.
11   *
12   * Redistribution and use in source and binary forms, with or
13   * without modification, are permitted provided that the following
14   * conditions are met:
15   *
16   * - Redistributions of source code must retain the above copyright
17   *   notice, this list of conditions and the following disclaimer.
18   *
19   * - Redistributions in binary form must reproduce the above
20   *   copyright notice, this list of conditions and the following
21   *   disclaimer in the documentation and/or other materials provided
22   *   with the distribution.
23   *
24   * - Neither the name of the Eclipse Foundation, Inc. nor the
25   *   names of its contributors may be used to endorse or promote
26   *   products derived from this software without specific prior
27   *   written permission.
28   *
29   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
30   * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
31   * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
32   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
34   * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
36   * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
37   * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
38   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
40   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
41   * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42   */
43  
44  package org.eclipse.jgit.transport;
45  
46  import org.eclipse.jgit.lib.Constants;
47  
48  /**
49   * Constants relating to ssh.
50   *
51   * @since 5.2
52   */
53  @SuppressWarnings("nls")
54  public final class SshConstants {
55  
56  	private SshConstants() {
57  		// No instances, please.
58  	}
59  
60  	/** IANA assigned port number for ssh. */
61  	public static final int SSH_DEFAULT_PORT = 22;
62  
63  	/** URI scheme for ssh. */
64  	public static final String SSH_SCHEME = "ssh";
65  
66  	/** URI scheme for sftp. */
67  	public static final String SFTP_SCHEME = "sftp";
68  
69  	/** Default name for a ssh directory. */
70  	public static final String SSH_DIR = ".ssh";
71  
72  	/** Name of the ssh config file. */
73  	public static final String CONFIG = Constants.CONFIG;
74  
75  	/** Default name of the user "known hosts" file. */
76  	public static final String KNOWN_HOSTS = "known_hosts";
77  
78  	// Config file keys
79  
80  	/** Key in an ssh config file. */
81  	public static final String BATCH_MODE = "BatchMode";
82  
83  	/** Key in an ssh config file. */
84  	public static final String CANONICAL_DOMAINS = "CanonicalDomains";
85  
86  	/** Key in an ssh config file. */
87  	public static final String CERTIFICATE_FILE = "CertificateFile";
88  
89  	/** Key in an ssh config file. */
90  	public static final String CIPHERS = "Ciphers";
91  
92  	/** Key in an ssh config file. */
93  	public static final String COMPRESSION = "Compression";
94  
95  	/** Key in an ssh config file. */
96  	public static final String CONNECTION_ATTEMPTS = "ConnectionAttempts";
97  
98  	/** Key in an ssh config file. */
99  	public static final String CONTROL_PATH = "ControlPath";
100 
101 	/** Key in an ssh config file. */
102 	public static final String GLOBAL_KNOWN_HOSTS_FILE = "GlobalKnownHostsFile";
103 
104 	/**
105 	 * Key in an ssh config file.
106 	 *
107 	 * @since 5.5
108 	 */
109 	public static final String HASH_KNOWN_HOSTS = "HashKnownHosts";
110 
111 	/** Key in an ssh config file. */
112 	public static final String HOST = "Host";
113 
114 	/** Key in an ssh config file. */
115 	public static final String HOST_KEY_ALGORITHMS = "HostKeyAlgorithms";
116 
117 	/** Key in an ssh config file. */
118 	public static final String HOST_NAME = "HostName";
119 
120 	/** Key in an ssh config file. */
121 	public static final String IDENTITIES_ONLY = "IdentitiesOnly";
122 
123 	/** Key in an ssh config file. */
124 	public static final String IDENTITY_AGENT = "IdentityAgent";
125 
126 	/** Key in an ssh config file. */
127 	public static final String IDENTITY_FILE = "IdentityFile";
128 
129 	/** Key in an ssh config file. */
130 	public static final String KEX_ALGORITHMS = "KexAlgorithms";
131 
132 	/** Key in an ssh config file. */
133 	public static final String LOCAL_COMMAND = "LocalCommand";
134 
135 	/** Key in an ssh config file. */
136 	public static final String LOCAL_FORWARD = "LocalForward";
137 
138 	/** Key in an ssh config file. */
139 	public static final String MACS = "MACs";
140 
141 	/** Key in an ssh config file. */
142 	public static final String NUMBER_OF_PASSWORD_PROMPTS = "NumberOfPasswordPrompts";
143 
144 	/** Key in an ssh config file. */
145 	public static final String PORT = "Port";
146 
147 	/** Key in an ssh config file. */
148 	public static final String PREFERRED_AUTHENTICATIONS = "PreferredAuthentications";
149 
150 	/** Key in an ssh config file. */
151 	public static final String PROXY_COMMAND = "ProxyCommand";
152 
153 	/** Key in an ssh config file. */
154 	public static final String REMOTE_COMMAND = "RemoteCommand";
155 
156 	/** Key in an ssh config file. */
157 	public static final String REMOTE_FORWARD = "RemoteForward";
158 
159 	/** Key in an ssh config file. */
160 	public static final String SEND_ENV = "SendEnv";
161 
162 	/** Key in an ssh config file. */
163 	public static final String STRICT_HOST_KEY_CHECKING = "StrictHostKeyChecking";
164 
165 	/** Key in an ssh config file. */
166 	public static final String USER = "User";
167 
168 	/** Key in an ssh config file. */
169 	public static final String USER_KNOWN_HOSTS_FILE = "UserKnownHostsFile";
170 
171 	// Values
172 
173 	/** Flag value. */
174 	public static final String YES = "yes";
175 
176 	/** Flag value. */
177 	public static final String ON = "on";
178 
179 	/** Flag value. */
180 	public static final String TRUE = "true";
181 
182 	/** Flag value. */
183 	public static final String NO = "no";
184 
185 	/** Flag value. */
186 	public static final String OFF = "off";
187 
188 	/** Flag value. */
189 	public static final String FALSE = "false";
190 
191 	// Default identity file names
192 
193 	/** Name of the default RSA private identity file. */
194 	public static final String ID_RSA = "id_rsa";
195 
196 	/** Name of the default DSA private identity file. */
197 	public static final String ID_DSA = "id_dsa";
198 
199 	/** Name of the default ECDSA private identity file. */
200 	public static final String ID_ECDSA = "id_ecdsa";
201 
202 	/** Name of the default ECDSA private identity file. */
203 	public static final String ID_ED25519 = "id_ed25519";
204 
205 	/** All known default identity file names. */
206 	public static final String[] DEFAULT_IDENTITIES = { //
207 			ID_RSA, ID_DSA, ID_ECDSA, ID_ED25519
208 	};
209 }