-
우분투 GUI에서도 root로 로그인을 허용하는 방법Ubuntu(20.04 LTS) 2021. 9. 17. 16:46728x90
아예 root로 로그인해야 하는 경우에는 아래 방법을 사용할 수 있다.
root 계정 암호 설정
우분투는 root 로그인 자체를 막아 놨으므로 root 계정 암호가 설정돼 있지 않다. root 계정으로 로그인하려면 root 계정 암호를 설정해야 한다.
아래 명령어로 설정하자.
sudo su passwd
우선 sudo su로 루트 권한을 얻고, passwd 명령어로 root 계정의 암호를 설정하는 것이다.
GDM 설정
/etc/gdm3/custom.conf 파일을 열여서 # TimedLoginDelay = 10 아랫줄에 AllowRoot=true라고 라인을 추가해 준다.
# GDM configuration storage # # See /usr/share/gdm/gdm.schemas for a list of available options. [daemon] AutomaticLoginEnable=True AutomaticLogin=urong # Uncomment the line below to force the login screen to use Xorg #WaylandEnable=false # Enabling automatic login # Enabling timed login # TimedLoginEnable = true # TimedLogin = user1 # TimedLoginDelay = 10 [security] [xdmcp] [chooser] [debug] # Uncomment the line below to turn on debugging # More verbose logs # Additionally lets the X server dump core if it crashes #Enable=true
gdm-password 파일 변경
/etc/pam.d/gdm-password 파일에서 아래 라인은 GUI에서 루트 계정을 사용할 수 없게 만드는 설정이다. 주석 처리 해서 효과가 없도록 만들자.
auth required pam_succeed_if.so user != root quiet_success
주석 처리를 하려면 맨 앞에 #을 붙인다. 그러면 아래처럼 될 것이다.
# auth required pam_succeed_if.so user != root quiet_success
/etc/pam.d/gdm-autologin 파일에서 auth required pam_succeed_if.so user != root quiet_success 라인도 주석처리를 해준다.
요약하면
- ~$# vi /etc/gdm3/custom.conf
[daemon]
AutomaticLoginEnable=true
AutomaticLogin=root
[security]
AllowRoot=true
- ~$# vi /etc/pam.d/gdm-password
#auth required pam_succeed_if.so user != root quiet_success
- ~$# vi /etc/pam.d/gdm-autologin
#auth required pam_succeed_if.so user != root quiet_success
재부팅
재부팅하면 GUI에서 root 계정으로 로그인할 수 있다.
계정명이 아닌 root로 로그인 된것을 확인할 수 있다.
계정이 root로 바뀌었기 때문에 이전에 설치했던 프로그램이 있다면 다시 설치 해야한다.
728x90반응형'Ubuntu(20.04 LTS)' 카테고리의 다른 글
우분투에 여러 java 버전 사용 (0) 2021.10.01 우분투 ROOT 계정 크롬 사용 (0) 2021.09.30 우분투 Tomcat 설치 (0) 2021.09.17 우분투 한글 설정 (0) 2021.09.17 우분투 20.04 LTS JAVA JDK 설치 (0) 2021.09.17 - ~$# vi /etc/gdm3/custom.conf