Linux 常用命令
Ssh 连接乱码编辑 vi /etc/sysconfig/i18n 最后面加上一行LANG="zh_CN.GB18030"
redhat系统 重置root密码
1.在出现grub画面时,用上下键选中你平时启动linux的那一项,然后按e键
2. 再次用上下键选中你平时启动linux的那一项(类似于kernel /boot/vmlinuz-2.4.18-14 ro root=LABEL=/),然后按e键
3. 在你现在见到的命令行后面,加入空格single,回车,结果如下:
(kernel /boot/vmlinuz-2.4.18-14 ro root=LABEL=/ single)
4. 然后选中“kernel /boot/vmlinuz-2.4.18-14 ro root=LABEL=/ single”按b键启动,即可直接进入系统的linux命令行
5. 在#提示符下直接输入命令:passwd root
关闭SELinux
修改/etc/selinux/config文件中的SELINUX="" 为 disabled ,然后重启。如果不想重启系统,使用命令setenforce 0
Linux关闭防火墙
iptables -F
挂载光盘
Mkdir /mnt/cd #建立挂载用目录
Mount /dev/cdrom /mnt/cd #开始挂载 会提示成功
mount: block device /dev/cdrom is write-protected, mounting read-only
umount /mnt/cd #取消挂载
Yum 从光盘安装 rpm
先使用上面的方法挂载光盘
Vi /etc/yum.repos.d/rhel-debuginfo.repo #修改yum 源地址
yum clean all #清空所有临时文件
Yum update #更新yum 源
Yum install httpd #安装 apache (在这里的包是 httpd 找了半天apache 没找到)
Yum remove php #卸载php
安装 lamp 环境
Yum install httpd*
Yum install php*
Yum install mysql*