image-ssh
Development Center ssh connection documentation
1. Official built-in mirrors
The following official built-in mirrors support SSH connection by default when you create a new development environment and have SSH connection switches.
2. Mirrors built by users based on official mirrors
Users based on the official (admin namespace, admin at the beginning) built-in mirror modified image, you need to play the label (Web IDE, CentOS desktop and Ubuntu desktop in any one of the labels) in order to support the SSH connection function.
3. Mirrors built by users themselves
If you want to support SSH connection function, you need to fulfill the following two conditions: 3.1. The sshd service needs to be installed in the mirror. 3.2. Modify the configuration of /etc/ssh/sshd_config (see example) in order to ensure the normal use of SSH connection function (the current platform provides the mirror does not support). redhat, Centos system, change the following "apt" to "yum Redhat and Centos systems, change "apt" to "yum". Add the following to the Dockerfile:
# Dockerfile
## FROM ubuntu
RUN apt update -y && apt install openssh-server -y && \
sed -i '/^#PasswordAuthentication/s/#PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config && \
sed -i 's/#PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config
## CMD ["bash"]
Set the label to SSH and don't set any other labels!
4. Images imported by users themselves
After importing the image, go to the development center, create a new operating system for that image, go to the operating system to install openssh-server, and modify the ssh configuration:
#Ubuntu example:
apt update -y && apt install openssh-server -y && \
sed -i '/^#PasswordAuthentication/s/#PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config && \
sed -i 's/#PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config
#Centos example:
yum install openssh-server -y
sed -i '/^#PasswordAuthentication/s/#PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config && \
sed -i 's/#PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config
At this point, you have finished modifying the configuration file and labeling the image. Save this image as a "new image" for next time. (Save image - SSH tag only - New instance in Development Center - Start using).
Use the development tool ssh to the instance: If SSH connection is enabled when you create a new development environment, SSH connection information will be displayed on the development environment instance. Using the local SSH connection tool, you can connect to the development environment by copying the SSH connection and password. If you have already started the development environment but have not enabled SSH connection, you can modify it to enable SSH connection. Restart the development environment after modification, wait for the development environment to run, you can see the SSH connection information. Vscode, pycharm and other IDEs, you can install the remote plugin to connect to the development environment.
Development Environment Connection Information
Vscode plugin connects to the development environment