Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2038831
  • 博文数量: 220
  • 博客积分: 8531
  • 博客等级: 中将
  • 技术积分: 4976
  • 用 户 组: 普通用户
  • 注册时间: 2007-07-18 13:33
文章分类

全部博文(220)

文章存档

2017年(1)

2015年(1)

2014年(5)

2013年(6)

2012年(6)

2011年(30)

2010年(37)

2009年(53)

2008年(41)

2007年(40)

分类: 其他平台

2017-06-29 20:37:19

    项目中用户使用普华服务器操作系统,有一个特殊的需求:默认进入3模式,只有tty2和tty3自动root登录,其他几个终端都不自动登录。
    tty之前是在inittab里面,不过从CentOS6之后,就在/etc/init/tty.conf里面配置了。参考网上资料,修改如下:
[root@fan3838 ~]# diff /etc/init/tty.conf ~/tty.conf.original
9c9
< exec /sbin/mingetty --autologin root $TTY
---
> exec /sbin/mingetty $TTY
[root@fan3838 ~]#
   但是这样是6个终端全部自动登录到root,还需要修改。开始想的是将每个终端都写明,不过发现不通过,google搜索资料后解决。

[root@fan3838 ~]# cat /etc/init/tty.conf 
# tty - getty
#
# This service maintains a getty on the specified device.
#
# Do not edit this file directly. If you want to change the behaviour,
# please create a file tty.override and put your changes there.


stop on runlevel [S016]


respawn
instance $TTY
#exec /sbin/mingetty --autologin root $TTY
#### CUT-HERE ####
script
if [ x$TTY = x"/dev/tty2" ] || [ x$TTY = x"/dev/tty3" ]; then
export AUTOLOGIN="--autologin"
export USER="root"
fi


exec /sbin/mingetty $AUTOLOGIN $USER $TTY
end script
#### CUT-HERE ####


usage 'tty TTY=/dev/ttyX  - where X is console id'
[root@fan3838 ~]# 

阅读(2821) | 评论(0) | 转发(0) |
0

上一篇:dell Venue 8 7840平板root手记

下一篇:没有了

给主人留下些什么吧!~~