--- daemon/sshd | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/daemon/sshd b/daemon/sshd index 1a1d59b4..6e5ef439 100755 --- a/daemon/sshd +++ b/daemon/sshd @@ -14,11 +14,15 @@ sshr_ip=$LKP_SERVER
run_ssh() { - [ -n "$pub_key" ] || return - umask 0077 - mkdir -p /root/.ssh - echo "$pub_key" > /root/.ssh/authorized_keys - systemctl start sshd + if [ -n "$pub_key" ] + then + vumask 0077 + mkdir -p /root/.ssh + echo "$pub_key" > /root/.ssh/authorized_keys + systemctl start sshd + else + echo "please check whether your pub_key exists" + fi }
data_success()
please ignore this email
On Fri, Oct 30, 2020 at 03:25:17PM +0800, Li Ping wrote:
daemon/sshd | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/daemon/sshd b/daemon/sshd index 1a1d59b4..6e5ef439 100755 --- a/daemon/sshd +++ b/daemon/sshd @@ -14,11 +14,15 @@ sshr_ip=$LKP_SERVER
run_ssh() {
- [ -n "$pub_key" ] || return
- umask 0077
- mkdir -p /root/.ssh
- echo "$pub_key" > /root/.ssh/authorized_keys
- systemctl start sshd
- if [ -n "$pub_key" ]
- then
vumask 0077
mkdir -p /root/.ssh
echo "$pub_key" > /root/.ssh/authorized_keys
systemctl start sshd
else
echo "please check whether your pub_key exists"
- fi
}
data_success()
2.23.0