免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 777 | 回复: 0
打印 上一主题 下一主题

liunx小技巧 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-09 09:49 |只看该作者 |倒序浏览
liunx小技巧
一、用/sbin/chkconfig命令 chkconfig --list 查看全部服务状态
例如:
运行chkconfig --list httpd
看自动启动状态
httpd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
0~6是指运行级别,一般服务器都运行在3这个级别上。
添加为自动启动
chkconfig --add httpd
或者指定运行级别
chkconfig --level 345 httpd on
停止自动启动
chkconfig --del httpd
或指定运行级别
chkconfig --level 345 httpd off
[email=Prim@Hosting]Prim@Hosting[/email]
提供的系统服务,详见下表
FTP服务:
/etc/init.d/muddleftpd stop
/etc/init.d/muddleftpd start
/etc/init.d/muddleftpd restart
SMTP服务:
/etc/init.d/postfix stop
/etc/init.d/postfix start
/etc/init.d/postfix reload
POP3服务:
/etc/init.d/courier-pop3d stop
/etc/init.d/courier-pop3d start
/etc/init.d/courier-pop3d restart
HTTP服务:
/etc/init.d/httpd stop/start/restart
JSP服务:
/etc/init.d/resin stop/start/restart
DNS服务:
/etc/init.d/named stop/start/restart
MySQL服务:
/etc/init.d/mysqld stop/start/restart

二、重设linux root密码
1. 用RedHat标准安装盘启动系统
当出现提示符时敲入:linux rescue
就会以修复模式启动系统
2. 系统启动完毕后,会将硬盘mount到/mnt/sysimage,届时会有提示
3. 进入提示符后,敲入命令:
chroot /mnt/sysimage
4. 敲入命令:
passwd
更改密码
5. 连续敲入两次exit,即重起系统,将光盘拿出,按正常模式启动系统

三、进入单用户模式
除了用光盘引导rescue模式,还有一种方法是用启动装载器来进入单用户模式:
1. grub
进入启动画面之后,敲入“e”,把光标移动到kernel ...那一行,再敲入“e”,在kernel 一行的最后加上空格single,回车
敲入“b”,启动系统,即进入单用户模式,
这个时候就可以用passwd命令改密码了。
2. lilo
进入lilo命令行模式,敲入linux single,即进入单用户模式。
passwd ...
如果grub/lilo设了密码,一定要记住才行。要是忘了grub/lilo的密码,就只有用rescue模式了。
over


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/1687/showart_523038.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP