In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article focuses on "how to log in to the docker container remotely". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to log in to the docker container remotely.
The docker container allows for remote connections, which can be made through putty or xshell. Here, take the Win10 system, docker:Version 17.06.0-ce-win19 (12801) as an example to introduce.
Container Management: kitematic for windows
Remote connection tool: xshell
Container system: ubuntu
Download the ubuntu container
Download the latest official version of ubuntu from ketematic
II. Preparatory work
Because many commands are not available in the newly installed official ubuntu, you need to install it yourself.
Apt-get updateapt-get install vim
Initialize the password for root
Sudo passwd root (use passwd root if the sudo command does not exist)
Then set the password.
Third, install ssh
Installation
Apt-get install openssh-server
View statu
Service ssh status
Turn on ssh
Service ssh start
Configure ssh and run root login
Vim / etc/ssh/sshd_config
The value of PermitRootLogin changed from prohibit-password to yes
As follows:
-PermitRootLogin prohibit-password + PermitRootLogin yes
Save after editing, and then restart ssh
Service ssh restart
Save changes to the current container
Open through kitematic, or open docker command operation through Docker Quickstart Terminal
Docker ps to see which docker is currently running
You can see what the container ID of the currently running ubuntu is.
Save the new container
Docker commit 66b34b5228d8
Note: syntax is docker commit container ID
Configure the container with an accessible port
Since the port of ssh is 22, we configure an external port to access the port in the container
Once configured, click Save, and the container will restart automatically.
Remarks: 1. External ports can be easily configured with a non-conflicting port.
2. After restarting the container, you may need to restart ssh,service ssh start
Connect the container through xshell and putty
All the above work is done, and we need to access it through the ip address of the docker (not through the ip address of the container, because it needs to be mapped).
Local cmd- "ipconfig to view the ip address of the current docker
You can connect through ssh client tools such as putty or xshell
At this point, I believe you have a deeper understanding of "remote login to the docker container". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.