- Documentation
Elastic Compute Service
Elastic Compute Service
Troubleshooting
Remote log in issue
Custom image issue
Why do I fail to log on to an instance created by using a Linux custom image from the Terminal or encounter network inaccessibility?
Custom image issue
Why do I fail to log on to an instance created by using a Linux custom image from the Terminal or encounter network inaccessibility?
Why do I fail to log on to an instance created by using a Linux custom image from the Terminal or encounter network inaccessibility?
The issue is most likely caused by abnormal Cloud-init execution, which leads to a connection anomaly. If you update the Python 3 version and modify the default Python interpreter (that is, creating a new symbolic link for the new Python 3 version) in the instance used to create a custom image, abnormal execution of the installed Cloud-init may occur. For example, when you execute the cloud-init --version command, the following error message is displayed:
You can update the custom image configuration and then recreate an instance by using one of the following methods.
- Method 1: Update the Python 3 version and reinstall Cloud-init. For more information, see Installing Cloud-init.
- Method 2: Modify the Cloud-init executable file. Refer to the following configuration to change the path corresponding to the Python interpreter to the path of the legacy Python 3 version. In this topic, Python 3.6 is used as the legacy Python 3 version.
- Execute the vim /usr/local/bin/cloud-init command to open the cloud-init file.
- Press i to enter edit mode and modify the content following #! at the beginning of the file to the path to Python 3.6.
- Press the Esc key to exit edit mode, and then enter :wq and press Enter to save and exit the file.
Last updated: 2026.06.18 17:49:52