• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] install ssh service to running container
is there a way to install an ssh service to a running container?
I tried to add 
Quote:        apt-get install -y git openssh-server \
   && echo
'root:root' | chpasswd \
   && sed -i
's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config \
   && sed
's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd \
   && mkdir /var/run/sshd \

manually to the installed nodered-fieldbus container and didnt get any errors 
but when trying to connect via putty, it says connection denied..
how to add ssh server correctly?

**i also published the port 22 when setting up the container
Well the code you mentioned in your post is just half of the work. The code installs everything needed for SSH. But you have to start the SSH server in your container

If you look for example to our Raspbian container here you will detect your code section there as well which is fine.

But there is also the start script entrypoint.sh. And in this start script the SSH server is started finally before the script vanishes in an endless loop.

Here is the code you find in there and you need to add to you start script as well:

echo "starting ssh ..."
sudo /etc/init.d/ssh start

You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

Okey thank you, that should help :-)

**its working Smile

Possibly Related Threads…
Thread Author Replies Views Last Post
  docker.service start failed EUROKEY 9 238 July-20th-2020, 10:01 AM
Last Post: Armin@netPI
  Exporting and importing container images Armin@netPI 3 162 May-20th-2020, 11:24 AM
Last Post: COswald
Exclamation Creating a container Linnerz 6 236 March-6th-2020, 02:47 PM
Last Post: Armin@netPI
  [SOLVED] activate LED1/2 with Node-RED + fieldbus nodes container Christian_Rau 6 264 October-21st-2019, 10:30 AM
Last Post: Armin@netPI
  Cannot start container Magnus 7 221 October-16th-2019, 01:00 PM
Last Post: Armin@netPI
  Generate VLAN interfaces in container FrankJacob 7 195 September-26th-2019, 03:19 PM
Last Post: Armin@netPI
  create container in Portainer v1.12.4 dcatteeu 2 141 September-9th-2019, 12:12 PM
Last Post: dcatteeu
  UMTS/LTE support via USB router/modem sticks in a container Armin@netPI 3 258 September-5th-2019, 02:07 PM
Last Post: Armin@netPI
  Ready-to-deploy: full featured Node-RED container Armin@netPI 5 287 July-25th-2019, 06:16 AM
Last Post: Armin@netPI
  New Container example "OPC UA server" Armin@netPI 0 139 April-12th-2019, 11:51 AM
Last Post: Armin@netPI

Forum Jump:

Users browsing this thread: 1 Guest(s)