if you want to use ssh port forwarding as systemd service, keep in mind that the default user for execution is root, and you need to use the public key of root to login.
or you can change the user executing the task in service config:
1 2 3
[System] User=xxx
chisel can be used for port forwarding by http compared with wstunnel, able to survive nginx (still need to configure websocket upgrades).
if you want to have multiple host sharing same ip because of proxy forwarding or different network locations, then you need to change the system host mapping file.
in linux and macos it is at /etc/hosts
in windows, C:\Windows\System32\drivers\etc\hosts
you need to configure the host file on the proxy machine if you want to avoid name clashes with proxies. these host names can be less informative to hide the intent.
on latest ubuntu 24.04 the sshd config includes files under /etc/ssh/sshd_config.d which has a file named 50-cloud-init.conf has the line overriding any other setting afterwords.
1 2
PasswordAuthentication yes
you need to change both /etc/ssh/sshd_config and this file to disable password authentication.
-R will not allow you to open 0.0.0.0 port on remote machine unless you configure something in /etc/ssh/sshd_config like below.
login mysql with empty password then execute command to make it remotely available:
1 2
mysql -uroot --password= -e "grant all privileges on *.* to root@'%' identified by '' with grant option; commit;"
create volume and attach volume to container, since containers will be reset after system restarts.
1 2 3 4
docker volume create <volume_name> docker run -it -d --rm -v <volume_name>:<container_mountpoint> --name <container_name> <image_name> docker volume inspect <volume_name> # get info on created volume
when using mindsdb, it sucks because having bad pypi mirrors.
set pip index url globally:
1 2
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
or pass it as environment variable:
1 2
docker run -it -d -e PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple -n <container_name> <image_name>
if you want to save container states into images, use docker commit <container_name> <image_name>[:image_tag]
Keep in mind that the docker commit command only saves the changes made to a container’s file system. It does not save any changes made to the container’s settings or network configurations. To save all changes made to a container, including settings and network configurations, you can use the docker export and docker import commands instead.
when exporting ports, if not specifying host ip, you cannot reach the service inside the container. do this instead: docker run -p 0.0.0.0:<host_port>:<container_port> <rest_commands>
it seems to be the proxy (fastgithub). disable http proxy so we can connect to container again, or use clash to make rules to let “localhost” or subnet requests passing through.
if you want to change ip routings or some other configurations passed when docker run, you need to change the file called hostconfig.json located in /var/lib/docker/containers/<container_id> with PortBindings sections. you stop the container first. find and change the config file then start it. tutorial
containers can only contact each other if they share the same network. better give unique ip for each container within same network. it can also use container name as host name instead of static ip. tutorial
create a network (not overlapping with anything shown in ifconfig, notice the subnet mask):