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 	/** Key in an ssh config file. */
105 	public static final String HOST = "Host";
106 
107 	/** Key in an ssh config file. */
108 	public static final String HOST_KEY_ALGORITHMS = "HostKeyAlgorithms";
109 
110 	/** Key in an ssh config file. */
111 	public static final String HOST_NAME = "HostName";
112 
113 	/** Key in an ssh config file. */
114 	public static final String IDENTITIES_ONLY = "IdentitiesOnly";
115 
116 	/** Key in an ssh config file. */
117 	public static final String IDENTITY_AGENT = "IdentityAgent";
118 
119 	/** Key in an ssh config file. */
120 	public static final String IDENTITY_FILE = "IdentityFile";
121 
122 	/** Key in an ssh config file. */
123 	public static final String KEX_ALGORITHMS = "KexAlgorithms";
124 
125 	/** Key in an ssh config file. */
126 	public static final String LOCAL_COMMAND = "LocalCommand";
127 
128 	/** Key in an ssh config file. */
129 	public static final String LOCAL_FORWARD = "LocalForward";
130 
131 	/** Key in an ssh config file. */
132 	public static final String MACS = "MACs";
133 
134 	/** Key in an ssh config file. */
135 	public static final String NUMBER_OF_PASSWORD_PROMPTS = "NumberOfPasswordPrompts";
136 
137 	/** Key in an ssh config file. */
138 	public static final String PORT = "Port";
139 
140 	/** Key in an ssh config file. */
141 	public static final String PREFERRED_AUTHENTICATIONS = "PreferredAuthentications";
142 
143 	/** Key in an ssh config file. */
144 	public static final String PROXY_COMMAND = "ProxyCommand";
145 
146 	/** Key in an ssh config file. */
147 	public static final String REMOTE_COMMAND = "RemoteCommand";
148 
149 	/** Key in an ssh config file. */
150 	public static final String REMOTE_FORWARD = "RemoteForward";
151 
152 	/** Key in an ssh config file. */
153 	public static final String SEND_ENV = "SendEnv";
154 
155 	/** Key in an ssh config file. */
156 	public static final String STRICT_HOST_KEY_CHECKING = "StrictHostKeyChecking";
157 
158 	/** Key in an ssh config file. */
159 	public static final String USER = "User";
160 
161 	/** Key in an ssh config file. */
162 	public static final String USER_KNOWN_HOSTS_FILE = "UserKnownHostsFile";
163 
164 	// Values
165 
166 	/** Flag value. */
167 	public static final String YES = "yes";
168 
169 	/** Flag value. */
170 	public static final String ON = "on";
171 
172 	/** Flag value. */
173 	public static final String TRUE = "true";
174 
175 	/** Flag value. */
176 	public static final String NO = "no";
177 
178 	/** Flag value. */
179 	public static final String OFF = "off";
180 
181 	/** Flag value. */
182 	public static final String FALSE = "false";
183 
184 	// Default identity file names
185 
186 	/** Name of the default RSA private identity file. */
187 	public static final String ID_RSA = "id_rsa";
188 
189 	/** Name of the default DSA private identity file. */
190 	public static final String ID_DSA = "id_dsa";
191 
192 	/** Name of the default ECDSA private identity file. */
193 	public static final String ID_ECDSA = "id_ecdsa";
194 
195 	/** Name of the default ECDSA private identity file. */
196 	public static final String ID_ED25519 = "id_ed25519";
197 
198 	/** All known default identity file names. */
199 	public static final String[] DEFAULT_IDENTITIES = { //
200 			ID_RSA, ID_DSA, ID_ECDSA, ID_ED25519
201 	};
202 }