在docker中启动ssh服务

在docker中先安装ssh服务

apt-get update
apt-get install vim -y
apt-get install openssh-server -y

vim /etc/ssh/sshd_config
添加PermitRootLogin yes
添加UsePAM no
开启port 8022等设置   否则和远程主机连接容易冲突,启动ssh失败
保存

passwd root
输入密码

service ssh start

提交docker 保存起来

docker commit -p c3a8af24659f lijianyu110/jetson-inference:jupyterlab-model-sshd-v1

docker push lijianyu110/jetson-inference:jupyterlab-model-sshd-v1

启动命令

docker run --runtime nvidia -it --rm --network host -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix -v /tmp/argus_socket:/tmp/argus_socket -v /etc/enctune.conf:/etc/enctune.conf -v ~/:/location -p 8022:8022 -p 8888:8888 --device /dev/video0 64634c55f60b

你可能感兴趣的:(docker,docker,ssh,linux)