• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] install ssh service to running container
#1
hello, 
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
  Reply
#2
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

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

  Reply
#3
Okey thank you, that should help :-)

**its working Smile
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Ready-to-deploy: full featured Node-RED container Armin@netPI 3 52 June-18th-2019, 02:45 PM
Last Post: AlexRegev
  New Container example "OPC UA server" Armin@netPI 0 13 April-12th-2019, 11:51 AM
Last Post: Armin@netPI
  Official Node-RED container Armin@netPI 0 17 April-5th-2019, 10:39 AM
Last Post: Armin@netPI
  Multi-stage builds for slim container images Armin@netPI 0 10 February-7th-2019, 04:14 PM
Last Post: Armin@netPI
Information [INFO] Setting the correct timezone in a container Armin@netPI 0 10 February-3rd-2019, 08:23 AM
Last Post: Armin@netPI
  [SOLVED] Unique identifier in container mmolder 1 25 January-23rd-2019, 03:06 PM
Last Post: Armin@netPI
  [SOLVED] Running Eclipse inside Docker Rahulsagar 6 52 January-21st-2019, 04:03 PM
Last Post: Rahulsagar
  [SOLVED] activate LED1/2 with Node-RED + fieldbus nodes container Christian_Rau 5 75 January-11th-2019, 08:06 AM
Last Post: Armin@netPI
  [SOLVED] Can't install Codesys License ffumagalli 4 150 November-22nd-2018, 10:58 AM
Last Post: Armin@netPI
  [SOLVED] nodered : flows_localhost deleted after creating an image from container paubau 6 186 September-21st-2018, 10:19 AM
Last Post: paubau

Forum Jump:


Users browsing this thread: 1 Guest(s)