You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adapt to a non-writeable /etc/passwd file in sshd Dockerfile.
The UDI image currently permits writing to /etc/passwd, and sets the
default user to have a login shell. Make /etc/passwd non-writable and
"disable" /sbin/nologin (by replacing it with /bin/bash) to ensure the
user starting the SSHD service may continue to log into the container
over SSH.
- Small improvements to presentation of landing page with
"Troubleshooting" section and emphasis on certain commands
- Include 'UserKnownHostsFile /dev/null' in recommended SSH
configuration section as this eliminates need to remove entries from
known_hosts if/when the Devworkspace's host key changes
Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
<li>Make sure your local oc client is logged in to your OpenShift cluster</li>
52
-
<li><p class="center">Run <code>oc port-forward ${process.env["HOSTNAME"]} 2022:2022</code>. This establishes a connection to the workspace.</p></li>
51
+
<li><p class="center">Run <code><b>oc port-forward ${process.env["HOSTNAME"]} 2022:2022</b></code>. This establishes a connection to the workspace.</p></li>
53
52
<li>
54
-
<p>In your local VS Code, connect to <code>localhost</code> on port <code>2022</code> with user <code>${process.env["USER_NAME"]}</code> ${hasUserPrefSSHKey ? `. The SSH key, corresponding to the following public key, configured in the "SSH Keys" tab of "User Preferences" has been authorized to connect :` : `and the following identity file :`}${keyMessage}
55
-
<pre>
53
+
<p>In your local VS Code, connect to <code>localhost</code> on port <code>2022</code> with user <code>${os.userInfo().username}</code> ${hasUserPrefSSHKey ? `. The SSH key, corresponding to the following public key, configured in the "SSH Keys" tab of "User Preferences" has been authorized to connect :` : `and the following identity file :`}${keyMessage}</p>
54
+
<p>
55
+
This can also be configured locally in <code>$HOME/.ssh/config</code> with the following :
56
+
<pre><b>
56
57
Host localhost
57
58
HostName 127.0.0.1
58
-
User ${process.env["USER_NAME"]}
59
+
User ${os.userInfo().username}
59
60
Port 2022
60
61
IdentityFile /path/to/the/ssh_client_ed25519_key
61
-
</pre>
62
+
UserKnownHostsFile /dev/null
63
+
</b></pre>
62
64
</p>
63
65
</li>
64
66
</ol>
65
-
<p>If the connection fails with "<code>WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED</code>", it may be necessary to remove the <code>localhost</code> or <code>127.0.0.1</code> entries from <code>$HOME/.ssh/known_hosts</code>. This is because the SSHD service container (to which <code>oc port-forward</code> is forwarding) may change.</p>
67
+
<h3>Troubleshooting</h3>
68
+
<p>If the connection fails with "<code>WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED</code>", it may be necessary to remove the <code>localhost</code> or <code>127.0.0.1</code> entries from <code>$HOME/.ssh/known_hosts</code>. This is because the SSHD service container (to which <code>oc port-forward</code> is forwarding) may change. This can be bypassed by setting <code>UserKnownHostsFile /dev/null</code></p>
69
+
<p>Please ensure the permissions on the private key used are restricted to allow only the file owner to read/write. The SSH service may fail to correctly authenticate otherwise.</p>
70
+
<p>The most common setup is to connect to the workspace using the "Remote - SSH Connection" from the corresponding editor's extension marketplace. If this setup fails to connect to the workspace, consider disabling the setting <code><b>remote.SSH.useExecServer</b></code> (set to false)</p>
71
+
<p>For any other issues, relating to the use of a VS Code-based editor and the "Remote - SSH connection", the "Remote - SSH" logs from the "Output" view are very helpful in diagnosing the issue.</p>
0 commit comments