Bob Mottram 8 년 전
부모
커밋
d235c8dbe4
1개의 변경된 파일3개의 추가작업 그리고 4개의 파일을 삭제
  1. 3
    4
      src/freedombone-utils-ssh

+ 3
- 4
src/freedombone-utils-ssh 파일 보기

@@ -40,12 +40,11 @@ function configure_ssh {
40 40
     if [[ $(is_completed $FUNCNAME) == "1" ]]; then
41 41
         return
42 42
     fi
43
-    if ! grep 'HostbasedAuthentication' /etc/ssh/sshd_config; then
43
+    if ! grep -q 'HostbasedAuthentication' /etc/ssh/sshd_config; then
44 44
         echo 'HostbasedAuthentication no' >> /etc/ssh/sshd_config
45
-    else
46
-        sed 's|#HostbasedAuthentication.*|HostbasedAuthentication no|g' /etc/ssh/sshd_config
47
-        sed 's|HostbasedAuthentication.*|HostbasedAuthentication no|g' /etc/ssh/sshd_config
48 45
     fi
46
+    sed 's|#HostbasedAuthentication.*|HostbasedAuthentication no|g' /etc/ssh/sshd_config
47
+    sed 's|HostbasedAuthentication.*|HostbasedAuthentication no|g' /etc/ssh/sshd_config
49 48
     sed -i 's|#PrintLastLog.*|PrintLastLog yes|g' /etc/ssh/sshd_config
50 49
     sed -i 's|PrintLastLog.*|PrintLastLog yes|g' /etc/ssh/sshd_config
51 50
     sed -i 's|#IgnoreRhosts.*|IgnoreRhosts yes|g' /etc/ssh/sshd_config