Linux 서버 계정 비밀번호 변경
[1] ROOT 계정으로 passwd "비밀번호 변경계정명" 기입하면되나, command not found 에러 발생함
bash-4.2# id
id=0(root) gid=0(root) groups=0(root)
bash-4.2# passwd oracle
bash: passwd: command not found
명령문 위치를 찾기, 없다고 나온다.
bash-4.2# which passwd
which: no passwd ~~
[2] PASSWD 패키지 설치
: Oracle Linux는 Red Hat Enterprise Linux (RHEL) 기반이기 때문에 root 계정으로 yum or dnf로 하여 passwd 패키지를 설치하면된다. Unbuntu, Demian은 apt-get / RHEL, Centos는 yum or dnf를 쓰면 된다.
# yum install passwd
Loaded plugins: ovl
ol7_UEKR5 | 3.0 kB 00:00:00
ol7_developer_EPEL | 3.6 kB 00:00:00
ol7_latest | 3.6 kB 00:00:00
(1/7): ol7_UEKR5/x86_64/updateinfo | 474 kB 00:00:01
(2/7): ol7_latest/x86_64/group_gz | 136 kB 00:00:01
(3/7): ol7_latest/x86_64/updateinfo | 3.6 MB 00:00:00
(4/7): ol7_developer_EPEL/x86_64/updateinfo | 1.3 MB 00:00:01
(5/7): ol7_developer_EPEL/x86_64/primary_db | 18 MB 00:00:02
(6/7): ol7_latest/x86_64/primary_db | 52 MB 00:00:03
(7/7): ol7_UEKR5/x86_64/primary_db | 80 MB 00:00:06
Resolving Dependencies
--> Running transaction check
---> Package passwd.x86_64 0:0.79-6.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
========================================================================================================
Package Arch Version Repository Size
========================================================================================================
Installing:
passwd x86_64 0.79-6.el7 ol7_latest 105 k
Transaction Summary
========================================================================================================
Install 1 Package
Total download size: 105 k
Installed size: 420 k
Is this ok [y/d/N]: y
Downloading packages:
passwd-0.79-6.el7.x86_64.rpm | 105 kB 00:00:03
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : passwd-0.79-6.el7.x86_64 1/1
Verifying : passwd-0.79-6.el7.x86_64 1/1
Installed:
passwd.x86_64 0:0.79-6.el7
Complete!
[3] ROOT, ORACLE 서버 계정 비밀번호 변경
1. 명령문 위치 확인
bash-4.2# which passwd
/usr/bin/passwd
2. 비밀번호 변경
# root password change
bash-4.2# passwd root
Changing password for user root.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.
# oracle password change
bash-4.2# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.
3. 변경한 비밀번호로 접속 TEST
# test
root@xxxx:~# docker exec -it fd1507236d81 /bin/bash
[oracle@oracle-19 ~]$ su -
Password:
Last login: Tue Jun 11 04:34:51 UTC 2024 on pts/2
Last failed login: Tue Jun 11 04:35:08 UTC 2024 on pts/2
There was 1 failed login attempt since the last successful login.
-bash-4.2#
'IT 지식 > Linux' 카테고리의 다른 글
Oracle Linux HardDisk vs Nvme I/O 성능 테스트 (0) | 2024.06.14 |
---|---|
Linux 일반 계정으로 sudo 명령어가 안될 때 or 패스워드 입력없이 실행하고 싶은 경우 (0) | 2024.06.13 |
Oracle Linux 서버 첫 화면 2가지 모드 (0) | 2024.06.12 |
vi,vim 필수 명령문 (0) | 2024.06.05 |
figlet 문자 크게 보이게하기 ( SID 확인 용도 ) (0) | 2024.05.24 |