Nehra Classes
7.8K subscribers
817 photos
32 videos
507 files
1.32K links
Download Telegram
Nehra Classes pinned Β«https://www.youtube.com/live/uaYkEAW3Aks?si=tezd_SWL6LhIGAzh Likes Target = 100 onlyΒ»
πŸ‘15
timestamp
81 B
πŸ‘1
πŸ‘3
πŸ“’ Notice to Nehra Classes Subscribers: Earn YouTube Badges for Learning! πŸŽ‰

Hello Nehra Classes family!

Exciting news! YouTube now offers certificates in the form of digital badges for learners who complete specific quizzes and courses on the platform. This means that for certain modules and quizzes provided by Nehra Classes, you can earn badges that will appear on your YouTube profile, showcasing your achievements and dedication to learning.

How It Works:

1. Participate in Nehra Classes’ quizzes and learning modules.


2. Complete the courses and quizzes as outlined in our videos.


3. Earn digital badges as a recognition of your hard work and effort!



These badges can be a great addition to your profile, showing the skills and knowledge you've gained with us. This feature enhances your learning experience and gives you something valuable to showcase!

Stay tuned for more updates on our upcoming quizzes and courses where you can earn these badges. Let’s keep learning and achieving together!

Warm regards,
Nehra Classes Team
❀7πŸ‘7
Nehra Classes pinned Β«https://www.youtube.com/live/xCyhrBUlbrU?si=M1cKP-pL4BszDZ0fΒ»
Hi Guys, as you know that our ongoing docker series is freely available to all the subscribers of Nehra Classes during the live sessions only. But in case you don't want to join the live sessions and want to watch these tutorials later you were required to join the extended level membership of our channel.

Now, we have a good news for you. Vikas sir has decided to put this training at standard level not extended because the training is currently going on and is not completed yet.

Now onwards standard level members can also watch these sessions without any issues.

But once this training gets completed it will be made available at extended level only.

Thank you
Nehra Classes
❀21πŸ‘7
To access Docker on a remote server from your local client, follow these steps:


---

1. Enable Docker Remote API on the Server

a) Edit the Docker Daemon Configuration

On the server, open the Docker daemon configuration file:

sudo nano /etc/docker/daemon.json

Add or update the following to enable the Remote API:

{
"hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2375"]
}

unix:///var/run/docker.sock allows local connections.

tcp://0.0.0.0:2375 binds Docker to all network interfaces.



b) Restart the Docker Service

sudo systemctl restart docker

c) Allow the Port in the Firewall

If using ufw:

sudo ufw allow 2375/tcp

If using firewalld:

sudo firewall-cmd --permanent --add-port=2375/tcp
sudo firewall-cmd --reload


> ⚠️ Warning: Port 2375 is unencrypted. For secure access, use TLS (explained below).




---

2. Access Docker Remotely from the Client

a) Set the Docker Host

On your local machine, set the DOCKER_HOST environment variable to the remote server’s IP and port:

export DOCKER_HOST=tcp://<remote-server-ip>:2375

Replace <remote-server-ip> with the server's IP address.


b) Run Docker Commands

Test the connection with:

docker info

If successful, this will show information about the remote Docker server.


c) Optional: Make the Setting Permanent

Add the export command to your shell configuration file (e.g., .bashrc or .zshrc).



---

3. Secure the Remote Access with TLS (Recommended)

a) Generate TLS Certificates on the Server

Create a directory for certificates:

mkdir -p /etc/docker/certs
cd /etc/docker/certs

Generate a CA key and certificate:

openssl genrsa -out ca-key.pem 2048
openssl req -new -x509 -key ca-key.pem -days 365 -out ca.pem

Generate a server key and certificate signing request (CSR):

openssl genrsa -out server-key.pem 2048
openssl req -subj "/CN=<server-ip>" -new -key server-key.pem -out server.csr
openssl x509 -req -days 365 -in server.csr -CA ca.pem -CAkey ca-key.pem -CAcreateserial -out server-cert.pem

Generate client certificates (optional, for client authentication):

openssl genrsa -out client-key.pem 2048
openssl req -subj "/CN=client" -new -key client-key.pem -out client.csr
openssl x509 -req -days 365 -in client.csr -CA ca.pem -CAkey ca-key.pem -CAcreateserial -out client-cert.pem


b) Configure Docker to Use TLS

Update /etc/docker/daemon.json:

{
"hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2376"],
"tlsverify": true,
"tlscacert": "/etc/docker/certs/ca.pem",
"tlscert": "/etc/docker/certs/server-cert.pem",
"tlskey": "/etc/docker/certs/server-key.pem"
}

Restart Docker:

sudo systemctl restart docker


c) Access the Secure API from the Client

Copy the CA and client certificates to the client machine.

Run Docker commands with TLS options:

docker --tlsverify --tlscacert=ca.pem --tlscert=client-cert.pem --tlskey=client-key.pem -H=tcp://<remote-server-ip>:2376 info



---

4. Verify and Test

Ensure the server is reachable via the specified port.

Use secure methods (e.g., TLS or SSH tunneling) to protect the connection.
πŸ‘10