[Linux] shell script로 password 변경

on_cloud·2023년 3월 23일
0

Linux

목록 보기
3/6
post-thumbnail

change to password in centOS

sed -i "s|#PasswordAuthentication no|PasswordAuthentication yes|g" /etc/ssh/sshd_config
systemctl restart sshd
echo '<password>' | passwd --stdin ec2-user

change to password in ubuntu

sed -i "s|#PasswordAuthentication no|PasswordAuthentication yes|g" /etc/ssh/sshd_config
systemctl restart sshd
echo '<ubuntu:password>' | chpasswd
profile
클라우드 엔지니어가 목표인 학생

0개의 댓글