
아래 echo 명령을 사용하여 일부 구성을 unix 엔드포인트에 복사하려고 합니다. 복사한 후 문자가 거의 누락되거나 접두사가 붙는 경우가 있습니다. 아래 예.
여기에 당신의 제안이 필요합니다.
set system login user b48368 authentication encrypted-password '$1$trz5zI9f$2jL1PHnXNxY/'
set system login user b48368 authentication plaintext-password ''
set system login user bb0k93 authentication encrypted-password '$1$/y8uENjM$C7WQQZDQRbRJOeh/'
set system login user bb0k93 authentication plaintext-password ''
set system login user bb0k93 level 'admin'
set system login user bb0r4w authentication encrypted-password '$1$2.i88iIa$ZkREPOKUNjaJflNJ4/'
set system login user bb0r4w authentication plaintext-password ''
set system login user 430140 authentication encrypted-password '$1$qs.a5lXh$zjsssrtmCjsaSIfAv1'
set system login user 430140 authentication plaintext-password ''
set system login user 430140 level 'admin'
set system login user pa3n authentication encrypted-password '$1$yffNZqPG$EpMR/2RxniVYq0'
set system login user pat3n authentication plaintext-password ''
set system login user pa4n authentication encrypted-password '$1$NKWjQnX8$ZExZcYAm7ECEyI2/'
set system login user pa4n authentication plaintext-password ''
set system login user pa5n authentication encrypted-password '$1$8Km21dzm$q2NlHcRlZX1Oc6M0'
set system login user pa5n authentication plaintext-password ''
set system login user pa6n authentication encrypted-password '$1$qjkBDXXU$vJn4o6gF7aK/i/'
set system login user patn authentication plaintext-password ''
set system login user root authentication encrypted-password '$1$T1PHVDEj$UXtfPX/yuGtm0'
set system login user root authentication plaintext-password ''
복사된 출력, 몇 개의 문자가 누락됨
set system login user a48368 authentication encrypted-password 'jL1hU238TJXNxY/'
set system login user a48368 authentication plaintext-password ''
set system login user ab0k93 authentication encrypted-password '$/y8uENjM/'
set system login user ab0k93 authentication plaintext-password ''
set system login user ab0k93 level 'admin'
set system login user ab0r4w authentication encrypted-password '.i88iIa/'
set system login user ab0r4w authentication plaintext-password ''
set system login user 430140 authentication encrypted-password '.a5lXh'
set system login user 430140 authentication plaintext-password ''
set system login user 430140 level 'admin'
set system login user pt3n authentication encrypted-password '/2RxnpQU7CiVYq0'
set system login user pa3n authentication plaintext-password ''
set system login user pa4n authentication encrypted-password '/'
set system login user pa4n authentication plaintext-password ''
set system login user pa5n authentication encrypted-password 'Km21dzm'
set system login user pa5n authentication plaintext-password ''
set system login user pa6n authentication encrypted-password '/oAi/'
set system login user pa6n authentication plaintext-password ''
set system login user root authentication encrypted-password '/yuGtuKm0'
답변1
echo 명령을 사용할 때 큰따옴표로 묶었을 가능성이 높습니다. 이를 통해 텍스트를 어느 정도 해석할 수 있습니다. 특히 $XXX는 변수 XXX로 인식되며 이에 대한 참조는 해당 변수의 내용(일반적으로 없음)으로 대체됩니다.
이 문제를 해결하려면 데이터를 다르게 입력하거나 문자열을 적절하게 이스케이프해야 합니다. 문자 그대로 해석되도록 "$" 기호 앞에 "\"를 붙여서 이 작업을 수행할 수 있습니다.
이를 어떻게 사용하는지(예: 소스) 조언하지 않았지만 이를 처리하는 또 다른 방법은 "여기 문서"를 사용하면 소스 파일의 입력을 원시 텍스트로 처리하고 리디렉션할 수 있습니다.