Skip to content

Commit 77b3a18

Browse files
nazariiglguohan
authored andcommitted
[ptf] Fixed root ssh authentication issue (#3192)
Signed-off-by: Nazarii Hnydyn <[email protected]>
1 parent 39b641e commit 77b3a18

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dockers/docker-ptf/Dockerfile.j2

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ RUN rm -rf /debs \
9797

9898
## Adjust sshd settings
9999
RUN mkdir /var/run/sshd \
100-
&& echo 'root:root' | chpasswd \
101-
&& sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config \
102-
&& sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config \
103-
&& sed -i '$aUseDNS no' /etc/ssh/sshd_config
100+
&& echo 'root:root' | chpasswd \
101+
&& sed -ri '/^#?PermitRootLogin/c\PermitRootLogin yes' /etc/ssh/sshd_config \
102+
&& sed -ri '/^#?UsePAM/c\UsePAM no' /etc/ssh/sshd_config \
103+
&& sed -ri '/^#?UseDNS/c\UseDNS no' /etc/ssh/sshd_config
104104

105105
COPY ["supervisord.conf", "/etc/supervisor/"]
106106
COPY ["conf.d/supervisord.conf", "conf.d/sshd.conf", "conf.d/ptf_nn_agent.conf", "/etc/supervisor/conf.d/"]

0 commit comments

Comments
 (0)