Community
    • 登入

    find config files that do not contain username and password

    已排程 已置頂 已鎖定 已移動 Help wanted · · · – – – · · ·
    4 貼文 2 Posters 884 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • Justin LangJ
      Justin Lang
      最後由 編輯

      I have several network configuration files in a folder. I want to find a config file that are not configured username and password. Is there a way to use regex to find all config files that do not contain the line username and password? thanks

      PeterJonesP 1 條回覆 最後回覆 回覆 引用 0
      • PeterJonesP
        PeterJones @Justin Lang
        最後由 編輯

        @Justin-Lang said in find config files that do not contain username and password:

        I have several network configuration files in a folder. I want to find a config file that are not configured username and password. Is there a way to use regex to find all config files that do not contain the line username and password? thanks

        Yes.

        Unfortunately, since you told us nothing about the format of the file (you could give us a dummied up version with fake data, but that keeps the same format – spaces, colons, etc --, select the text data, and hit the </> button to mark it as “literal” text for the forum)

        – if you give us example data, someone might be able to hazard a guess as to the regex that will work. If you give us examples of files that should match (ie, do not contain user/pw) and files that shouldn’t match (ie, do contain user/pw), that will be better.

        With that regex, you would then use Search > Find in Files, it will list the files that match (or, in this case, the ones that match not having the user/pw – typing so negatively is difficult; I feel sorry for the non-native-English-speakers reading this reply right now…)

        Justin LangJ 1 條回覆 最後回覆 回覆 引用 0
        • Justin LangJ
          Justin Lang @PeterJones
          最後由 編輯

          @PeterJones

          service nagle
          no service pad
          service timestamps debug datetime localtime
          service timestamps log datetime localtime
          service password-encryption
          logging buffered 15000
          logging console critical
          logging monitor warnings
          enable secret 0 cisco
          username admin password cisco
          ^
          line con 0
          line vty 0 4
          exec-timeout 30 0
          privilege level 15
          transport preferred ssh
          transport input ssh
          transport output ssh
          line vty 5 15
          exec-timeout 30 0
          privilege level 15
          transport preferred ssh
          transport input ssh
          transport output ssh
          ntp source Loopback0
          ntp server 10.1.0.6
          ntp server 10.1.0.7
          ntp server 10.1.0.8 prefer
          port-channel load-balance src-dst-ip

          PeterJonesP 1 條回覆 最後回覆 回覆 引用 0
          • PeterJonesP
            PeterJones @Justin Lang
            最後由 編輯

            @Justin-Lang ,

            I replied in the second topic you created.

            1 條回覆 最後回覆 回覆 引用 0
            • 第一個貼文
              最後的貼文
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors