[PATCH lkp-tests] daemon/sshd: fix pub_key to my_ssh_pubkey

[why] - "my_ssh_pubkey" field is a set of all pub_keys that had been submitted by users. - We can save all the pub_keys submitted by users in the ES database and set the login mode to password-free. - Therefore, users can sometimes borrow a machine to test without providing a pub_key. Signed-off-by: Zhang Yale <ylzhangah@qq.com> --- daemon/sshd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/daemon/sshd b/daemon/sshd index a3fdf954..7919f81d 100755 --- a/daemon/sshd +++ b/daemon/sshd @@ -1,5 +1,5 @@ #!/bin/sh -# pub_key +# my_ssh_pubkey # my_email # sshr_port # sshr_port_len @@ -14,10 +14,10 @@ sshr_ip=$LKP_SERVER run_ssh() { - [ -n "$pub_key" ] || return + [ -n "$my_ssh_pubkey" ] || return umask 0077 mkdir -p /root/.ssh - echo "$pub_key" > /root/.ssh/authorized_keys + echo "$my_ssh_pubkey" > /root/.ssh/authorized_keys systemctl start sshd } @@ -54,7 +54,7 @@ Subject: [NOTIFY Compass-ci] Applying $testbox failed Dear $my_username: Sorry to inform you that your application failed. - You may need to wait a moment, or check whether your pub_key exists. + You may need to wait a moment, or check whether your my_ssh_pubkey exists. Regards Compass-Ci @@ -73,11 +73,11 @@ compose_email() set_port() { - [ -n "$pub_key" ] || return + [ -n "$my_ssh_pubkey" ] || return for i in $(seq 1 10) do - port=$(($(date +%s%N)%${sshr_port_len}+${sshr_port_base})) + port=$(($(date +%s%N)%$sshr_port_len+$sshr_port_base)) ssh -o StrictHostKeyChecking=no -o ExitOnForwardFailure=yes -o TCPKeepAlive=yes \ -Nf -R $port:localhost:22 sshr@"$sshr_ip" -p "$sshr_port" &>/dev/null [ $? -eq 0 ] && return -- 2.23.0

On Wed, Nov 25, 2020 at 11:00:44AM +0800, Zhang Yale wrote:
[why] - "my_ssh_pubkey" field is a set of all pub_keys that had been submitted by users. - We can save all the pub_keys submitted by users in the ES database and set the login mode to password-free. - Therefore, users can sometimes borrow a machine to test without providing a pub_key.
Signed-off-by: Zhang Yale <ylzhangah@qq.com> --- daemon/sshd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/daemon/sshd b/daemon/sshd index a3fdf954..7919f81d 100755 --- a/daemon/sshd +++ b/daemon/sshd @@ -1,5 +1,5 @@ #!/bin/sh -# pub_key +# my_ssh_pubkey # my_email # sshr_port # sshr_port_len @@ -14,10 +14,10 @@ sshr_ip=$LKP_SERVER
run_ssh() { - [ -n "$pub_key" ] || return + [ -n "$my_ssh_pubkey" ] || return umask 0077 mkdir -p /root/.ssh - echo "$pub_key" > /root/.ssh/authorized_keys + echo "$my_ssh_pubkey" > /root/.ssh/authorized_keys systemctl start sshd }
@@ -54,7 +54,7 @@ Subject: [NOTIFY Compass-ci] Applying $testbox failed
Dear $my_username: Sorry to inform you that your application failed. - You may need to wait a moment, or check whether your pub_key exists. + You may need to wait a moment, or check whether your my_ssh_pubkey exists.
The scheduler add the field my_ssh_pubkey, user's yaml only has pub_key. Thanks, Xueliang
Regards Compass-Ci @@ -73,11 +73,11 @@ compose_email()
set_port() { - [ -n "$pub_key" ] || return + [ -n "$my_ssh_pubkey" ] || return
for i in $(seq 1 10) do - port=$(($(date +%s%N)%${sshr_port_len}+${sshr_port_base})) + port=$(($(date +%s%N)%$sshr_port_len+$sshr_port_base)) ssh -o StrictHostKeyChecking=no -o ExitOnForwardFailure=yes -o TCPKeepAlive=yes \ -Nf -R $port:localhost:22 sshr@"$sshr_ip" -p "$sshr_port" &>/dev/null [ $? -eq 0 ] && return -- 2.23.0

On Wed, Nov 25, 2020 at 11:28:31AM +0800, Cao Xueliang wrote:
On Wed, Nov 25, 2020 at 11:00:44AM +0800, Zhang Yale wrote:
[why] - "my_ssh_pubkey" field is a set of all pub_keys that had been submitted by users. - We can save all the pub_keys submitted by users in the ES database and set the login mode to password-free. - Therefore, users can sometimes borrow a machine to test without providing a pub_key.
Signed-off-by: Zhang Yale <ylzhangah@qq.com> --- daemon/sshd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/daemon/sshd b/daemon/sshd index a3fdf954..7919f81d 100755 --- a/daemon/sshd +++ b/daemon/sshd @@ -1,5 +1,5 @@ #!/bin/sh -# pub_key +# my_ssh_pubkey # my_email # sshr_port # sshr_port_len @@ -14,10 +14,10 @@ sshr_ip=$LKP_SERVER
run_ssh() { - [ -n "$pub_key" ] || return + [ -n "$my_ssh_pubkey" ] || return umask 0077 mkdir -p /root/.ssh - echo "$pub_key" > /root/.ssh/authorized_keys + echo "$my_ssh_pubkey" > /root/.ssh/authorized_keys systemctl start sshd }
@@ -54,7 +54,7 @@ Subject: [NOTIFY Compass-ci] Applying $testbox failed
Dear $my_username: Sorry to inform you that your application failed. - You may need to wait a moment, or check whether your pub_key exists. + You may need to wait a moment, or check whether your my_ssh_pubkey exists.
The scheduler add the field my_ssh_pubkey, user's yaml only has pub_key.
Thanks, Xueliang
Ok, I got it. Thanks, Yale
Regards Compass-Ci @@ -73,11 +73,11 @@ compose_email()
set_port() { - [ -n "$pub_key" ] || return + [ -n "$my_ssh_pubkey" ] || return
for i in $(seq 1 10) do - port=$(($(date +%s%N)%${sshr_port_len}+${sshr_port_base})) + port=$(($(date +%s%N)%$sshr_port_len+$sshr_port_base)) ssh -o StrictHostKeyChecking=no -o ExitOnForwardFailure=yes -o TCPKeepAlive=yes \ -Nf -R $port:localhost:22 sshr@"$sshr_ip" -p "$sshr_port" &>/dev/null [ $? -eq 0 ] && return -- 2.23.0

On Wed, Nov 25, 2020 at 11:00:44AM +0800, Zhang Yale wrote:
[why] - "my_ssh_pubkey" field is a set of all pub_keys that had been submitted by users. - We can save all the pub_keys submitted by users in the ES database and set the login mode to password-free. - Therefore, users can sometimes borrow a machine to test without providing a pub_key.
it looks like to be deleted contents, whether to cheange format as follow 1) .... 2) .... 3) .... or a) .... b) .... c) .... Thanks, Liushaofei
Signed-off-by: Zhang Yale <ylzhangah@qq.com> --- daemon/sshd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/daemon/sshd b/daemon/sshd index a3fdf954..7919f81d 100755 --- a/daemon/sshd +++ b/daemon/sshd @@ -1,5 +1,5 @@ #!/bin/sh -# pub_key +# my_ssh_pubkey # my_email # sshr_port # sshr_port_len @@ -14,10 +14,10 @@ sshr_ip=$LKP_SERVER
run_ssh() { - [ -n "$pub_key" ] || return + [ -n "$my_ssh_pubkey" ] || return umask 0077 mkdir -p /root/.ssh - echo "$pub_key" > /root/.ssh/authorized_keys + echo "$my_ssh_pubkey" > /root/.ssh/authorized_keys systemctl start sshd }
@@ -54,7 +54,7 @@ Subject: [NOTIFY Compass-ci] Applying $testbox failed
Dear $my_username: Sorry to inform you that your application failed. - You may need to wait a moment, or check whether your pub_key exists. + You may need to wait a moment, or check whether your my_ssh_pubkey exists.
Regards Compass-Ci @@ -73,11 +73,11 @@ compose_email()
set_port() { - [ -n "$pub_key" ] || return + [ -n "$my_ssh_pubkey" ] || return
for i in $(seq 1 10) do - port=$(($(date +%s%N)%${sshr_port_len}+${sshr_port_base})) + port=$(($(date +%s%N)%$sshr_port_len+$sshr_port_base)) ssh -o StrictHostKeyChecking=no -o ExitOnForwardFailure=yes -o TCPKeepAlive=yes \ -Nf -R $port:localhost:22 sshr@"$sshr_ip" -p "$sshr_port" &>/dev/null [ $? -eq 0 ] && return -- 2.23.0

On Wed, Nov 25, 2020 at 02:44:15PM +0800, Liu Shaofei wrote:
On Wed, Nov 25, 2020 at 11:00:44AM +0800, Zhang Yale wrote:
[why] - "my_ssh_pubkey" field is a set of all pub_keys that had been submitted by users. - We can save all the pub_keys submitted by users in the ES database and set the login mode to password-free. - Therefore, users can sometimes borrow a machine to test without providing a pub_key.
it looks like to be deleted contents, whether to cheange format as follow
1) .... 2) .... 3) ....
or
a) .... b) .... c) ....
Thanks, Liushaofei
good, I got it. Thanks, Yale
Signed-off-by: Zhang Yale <ylzhangah@qq.com> --- daemon/sshd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/daemon/sshd b/daemon/sshd index a3fdf954..7919f81d 100755 --- a/daemon/sshd +++ b/daemon/sshd @@ -1,5 +1,5 @@ #!/bin/sh -# pub_key +# my_ssh_pubkey # my_email # sshr_port # sshr_port_len @@ -14,10 +14,10 @@ sshr_ip=$LKP_SERVER
run_ssh() { - [ -n "$pub_key" ] || return + [ -n "$my_ssh_pubkey" ] || return umask 0077 mkdir -p /root/.ssh - echo "$pub_key" > /root/.ssh/authorized_keys + echo "$my_ssh_pubkey" > /root/.ssh/authorized_keys systemctl start sshd }
@@ -54,7 +54,7 @@ Subject: [NOTIFY Compass-ci] Applying $testbox failed
Dear $my_username: Sorry to inform you that your application failed. - You may need to wait a moment, or check whether your pub_key exists. + You may need to wait a moment, or check whether your my_ssh_pubkey exists.
Regards Compass-Ci @@ -73,11 +73,11 @@ compose_email()
set_port() { - [ -n "$pub_key" ] || return + [ -n "$my_ssh_pubkey" ] || return
for i in $(seq 1 10) do - port=$(($(date +%s%N)%${sshr_port_len}+${sshr_port_base})) + port=$(($(date +%s%N)%$sshr_port_len+$sshr_port_base)) ssh -o StrictHostKeyChecking=no -o ExitOnForwardFailure=yes -o TCPKeepAlive=yes \ -Nf -R $port:localhost:22 sshr@"$sshr_ip" -p "$sshr_port" &>/dev/null [ $? -eq 0 ] && return -- 2.23.0
participants (3)
-
Cao Xueliang
-
Liu Shaofei
-
Zhang Yale