Focus On Oracle

Installing, Backup & Recovery, Performance Tuning,
Troubleshooting, Upgrading, Patching

Oracle Engineered System


当前位置: 首页 » 技术文章 » Oracle

How to enable autologin on OEL6/7

通过以下的设置,可以设置用户自动登录。有两种模式,一种是在GUI(X11)模式下,一种是在Full multiuser mode下。
注意:在虚拟环境中使用,不要在生产环境中使用

    # Default runlevel. The runlevels used are:
    #   0 - halt (Do NOT set initdefault to this)
    #   1 - Single user mode
    #   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
    #   3 - Full multiuser mode
    #   4 - unused
    #   5 - X11
    #   6 - reboot (Do NOT set initdefault to this)

A.在X11模式下
通过编辑文件/etc/gdm/custom.conf,然后修改[daemon]部分。此方法在Full multiuser mode下不起作用。下面的例子是用root自动登录
  1.设置为自动登录,立即生效
    [daemon]
    AutomaticLoginEnable=true
    AutomaticLogin=root

  2.设置为延时自动登录,下面的意思是在120秒后会自动用root登录如果没有用其他用户登录
    [daemon]
    TimedLoginEnable=true
    TimedLogin=root
    TimedLoginDelay=120

B.在Full multiuser mode模式下
执行完下面的脚本后,重启后即可生效
    sed -i -e 's/exec \/sbin\/mingetty $TTY/exec \/sbin\/mingetty --autologin root $TTY/g' /etc/init/tty.conf
    chmod u+w /etc/shadow
    sed -i -e 's/^root:[^:]*:/root::/g' /etc/shadow
    chmod u-w /etc/shadow
    sed -i -e 's/#PermitEmptyPasswords .*/PermitEmptyPasswords yes/g' /etc/ssh/sshd_config

Reference
https://help.gnome.org/admin/gdm/stable/configuration.html.en

http://www.thatsgeeky.com/2012/03/root-autologin-on-centos/

https://oracle-base.com/articles/linux/linux-automatic-or-timed-login


关键词:autologin linux 

相关文章

Install oracle products on docker
How to enable autologin on OEL6/7
Linux的分支有多少,你知道么?
Linux下配置vsftpd
如何配置HITACHI存储多路径软件
Exadata OS用户的密码策略
whats sosreport
Config xming+putty for X11 forwarding
在Linux中如何重置root密码,当你忘记时
在Oracle Enterprise Linux上使用nmon
如何在Windows和Linux上启用Large page
Linux性能优化方面的"神图"
Top