구성 파일에는 다음 줄이 있습니다.
Ciphers aes128-ctr,aes192-ctr,aes256-ctr
따라서 이 줄을 주석 처리하고 주석 처리된 줄 뒤에 다음 줄을 추가해야 합니다.
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour
PubkeyAcceptedKeyTypes [email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,ssh-rsa,ssh-dss
HostKeyAlgorithms [email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ssh-ed25519,ssh-rsa,ssh-dss
출력은 다음 형식이어야 합니다.
#Ciphers aes128-ctr,aes192-ctr,aes256-ctr
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour
PubkeyAcceptedKeyTypes [email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,ssh-rsa,ssh-dss
HostKeyAlgorithms [email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ssh-ed25519,ssh-rsa,ssh-dss
답변1
노력하다
sed '/Ciphers aes128-ctr,aes192-ctr,aes256-ctr/ {s/^/#/; a\
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128cbc,3des-cbc,blowfish-cbc,cast128- . . .
}' file