How do i make this non-interactive?
RUN /usr/bin/sudo apt-get install -y openssh-server openssh-client WORKDIR /home/hadoop_admin RUN mkdir /home/hadoop_admin/.ssh RUN chmod 700 /home/hadoop_admin/.ssh RUN ssh-keygen -t rsa -P "" -f ~/.ssh/id_dsa RUN cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
When i start ssh service, it asks for yes/no like the below. I want to make it yes always.
The authenticity of host 'localhost (::1)' can't be established. ECDSA key fingerprint is [long hexa key value] Are you sure you want to continue connecting (yes/no)? yes
One Solution collect form web for “How do i make this non-interactive?”
This post has several considerations.
1) What is exactly the command that you are executing, so this error is raised ?Because it recalls me that is a ssh client trying to access to the ssh server. If so, you can add this parameter to the ssh client to avoid the error … but it has security considerations.
echo 'Host * StrictHostKeyChecking no' >> ~/.ssh/config
2) You can use a docker base image that has, among many other things, already the SSH server configured http://phusion.github.io/baseimage-docker/
3) For the ssh client that is trying to connect to the server, you could auto-populate known_host before connecting via ssh
ssh-keyscan -t rsa,dsa localhost >> $HOME/.ssh/known_hosts
4) If you are using docker containers, you should not need to SSH to the containers. If you SSH need to manage the containers it is recommended to use nsenter or any other alternative.