您的位置:首页 > 其它

关于右下角托盘图标消失的终级解决方案

2010-01-04 08:39 561 查看
1. 新安装一台RHEL 6.x 或 CentOS 6.x 虚拟机1)关闭防火墙、SELinux[root@localhost ~]# service iptables stop // 关闭防火墙iptables:清除防火墙规则: [确定]iptables:将链设置为政策 ACCEPT:filter [确定]iptables:正在卸载模块: [确定][root@localhost ~]# chkconfig iptables off [root@localhost ~]# vim /etc/sysconfig/selinux // vim:编辑器.. .. .. 7 SELINUX=disabled // 禁用SELINUX.. .. ..2)使用光盘中的软件包为本机配置YUM源 【 提示:指到光盘根目录,不要指向Packages】[root@localhost ~]# cd /etc/yum.repos.d/ // yum配置仓库[root@localhost yum.repos.d]# lsrhel-source.repo // yum源配置模板[root@localhost yum.repos.d]# cp rhel-source.repo xobye.repo[root@localhost yum.repos.d]# vim xobye.repo [root@localhost yum.repos.d]# cat xobye.repo [rhel-xobye] // 自定义源名称,具有唯一性name=Red Hat Enterprise Linux // 本软件源的描述baseurl=file:///misc/cd/ // 指定yum服务端的地址enabled=1 // 是否启用该频道(1:启用,0:禁用)gpgcheck=1 // 是否验证待安装的软件包gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release // 软件包验证的密钥文件2,查看当前主机名,然后设置为 youname.nsd1308.com[root@localhost ~]# hostname // 查看主机名localhost.localdomain[root@localhost ~]# hostname xobye.tarena.com // 临时修改主机名3,查看当前主机的IP,临时设置当前IP为192.168.10.X[root@localhost ~]# ifconfig // 查看网卡信息[root@localhost ~]# ifconfig eth2 192.168.10.100/24 // 临时修改ip地址4,查看CPU与内存信息[root@localhost ~]# cat /proc/cpuinfo // CPU信息.. .. ..[root@localhost ~]# cat /proc/meminfo // 内存信息.. .. ..5,查看系统具体属于RedHat哪一个版本[root@localhost ~]# cat /etc/redhat-release // 红帽系统版本Red Hat Enterprise Linux Server release 6.4 (Santiago)6,查看当前系统的时间[root@localhost ~]# date // 当前时间2014年 07月 05日 星期六 19:36:28 CST7,列出/etc目录属性[root@localhost ~]# ls -ld /etc/ //-l:长格式显示 -d:显示目录本身属性drwxr-xr-x. 115 root root 12288 7月 5 19:30 /etc/8,递归显示/boot目录下的文件和内容[root@localhost ~]# ls -R /boot/ //-R:递归显示9,显示root下面所有文件包括隐藏文件[root@localhost ~]# ls -a /boot //-a:显示所有10,进入/tmp目录,删除所有文件和目录,创建file1.txt file2.txt file3.txt file13.txt filea.txt fileab.txt[root@localhost ~]# cd /tmp/[root@localhost tmp]# rm -rf * // 删除 *:所有[root@localhost tmp]# touch file1.txt file2.txt file3.txt file13.txt filea.txt filecb.txt[root@xobye tmp]# lsfile13.txt file1.txt file2.txt file3.txt filea.txt filecb.txt11,显示file开头的,以.txt结尾的,中间2个字符的文件[root@localhost ~]# find /tmp/ -name file??.txt //-name:按名称查找 ?代表一个字符/tmp/file13.txt/tmp/fileab.txt12,显示file开头的,以.txt结尾的,中间是单个数字的文件[root@localhost ~]# find /tmp/ -name file?.txt /tmp/file2.txt/tmp/filea.txt/tmp/file1.txt/tmp/file3.txt13,显示file开头的,以.txt结尾的,中间部分可能是1 3 a ab的文件[root@localhost ~]# ls /tmp/file{1,3,a,ab}.txt // {查找条件,查找多个之间用,隔开}/tmp/file1.txt /tmp/file3.txt /tmp/fileab.txt /tmp/filea.txt14,查看/boot和/etc/pki分别占用多大空间[root@xobye ~]# du -sh /boot/ /etc/pki/ //-s:汇总 –h:人性化显示27M/boot/1.6M/etc/pki/15,查看/etc/passwd前5行[root@xobye ~]# head -5 /etc/passwd //head:列出开头.. .. ..16,查看/etc/passwd尾5行[root@xobye ~]# tail -5 /etc/passwd //tail:列出结尾.. .. ..17,查看/etc/passwd的第8-12行[root@xobye ~]# head -12 /etc/passwd | tail -5 // |:管道输出18,统计系统中有多少个账户[root@xobye ~]# cat /etc/passwd | wc –l //wc:文件字数统计 –l:行数3319,计算/etc目录下.conf配置文件的个数[root@xobye ~]# ls /etc/*.conf | wc -l4520,显示/etc/passwd中以root开头的内容[root@xobye ~]# cat /etc/passwd | grep ^root //grep:过滤 ^:以什么开头root:x:0:0:root:/root:/bin/bash21,显示/etc/passwd中以bash结尾的内容[root@localhost ~]# cat /etc/passwd | grep bash$ //$:以什么结尾root:x:0:0:root:/root:/bin/bashStudent:x:500:500::/home/Student:/bin/bashstu01:x:501:501::/opt/stu01:/bin/bashstu02:x:10001:501::/home/stu02:/bin/bashxxx:x:10002:501::/home/xxx:/bin/bashsys02:x:10004:10004::/home/sys02:/bin/bashstudent:x:10005:10005::/home/student:/bin/bash22,分别使用gzip和bzip2和zip对/root/gztest.txt进行压缩和解压[root@localhost ~]# gzip gztest.txt // 压缩 .gz[root@localhost ~]# bzip2 gztest.txt // 压缩 .bz2[root@localhost ~]# zip gztest.txt.zip gztest.txt // 压缩 .zip[root@localhost ~]# gzip -d gztest.txt.gz //-d:执行减压[root@localhost ~]# bzip2 -d gztest.txt.bz2[root@localhost ~]# unzip -d /root/ gztest.zip //-d:指定目标文件夹23,把/etc/mail打包并压缩到/root/mail.tar.gz[root@localhost ~]# tar -zcf /root/mail.tar.gz /etc/mail //-z:调用gzip执行压缩 -c:创建.tar格式的归档文件 -f:表示使用归档文件24,把/etc/mail打包并压缩到/root/mail.tar.bz2[root@localhost ~]# tar -jcf /root/mail.tar.gz2 /etc/mail //-j:调用bzip2执行压缩25,将mail.tar.gz解压到/tmp下,递归查看/tmp/etc下的内容,然后删除/tmp/etc目录[root@localhost ~]# tar -zxf mail.tar.gz -C /tmp/ //-x:解压.tar的归档文件 -C:解包时指定释放的目标文件夹[root@localhost ~]# ls -R /tmp/etc/ //-R:递归[root@localhost ~]# rm -rf /tmp/etc/ // 删除26,将mail.tar.bz2解压到/tmp下,递归查看/tmp/etc下的内容,然后删除/tmp/etc目录[root@localhost ~]# tar -jxf mail.tar.bz2 -C /tmp/[root@localhost ~]# ls -R /tmp/etc/[root@localhost ~]# rm -rf /tmp/etc/27,分别查看mail.tar.gz与mail.tar.bz2文件里面内容[root@localhost ~]# tar tf mail.tar.gz //-t:列表查看包内的文件[root@localhost ~]# tar tf mail.tar.bz2 //-f:表示使用归档文件28,创建账户 Student[root@localhost ~]# useradd Student stu01,宿主目录设为/opt/stu01[root@localhost ~]# useradd -d /opt/stu01 stu01 //-d:指定宿主目录 stu02,uid为10001,账户在2015-06-30号过期,基本组设为stu01[root@localhost ~]# useradd -u 10001 -e 2015-06-30 -g stu01 stu02 //-u:指定UID号 –e:指定账户失效时间 -g:指定所属基本组 sys01,不用于登录[root@localhost ~]# useradd -s /sbin/nologin sys01 //-s:指定用户登录shell /sbin/nologin:可禁止用户登录sys02,不创建宿主目录[root@localhost ~]# useradd -M sys02 //-M:不为用户建立属主目录29,查看/etc/passwd文件的第一行[root@localhost ~]# head -1 /etc/passwdroot:x:0:0:root:/root:/bin/bash30,查看/etc/shadow文件的第一行[root@localhost ~]# head -1 /etc/shadowroot:$6$wS49oMze$UmdHQan/MNV8tRLqDaQ/oRldx6Wq2mHXQNcdVeZVMLQbPaaF1AeL5zRsA/qBDXn1rJgXMlpVmKZxA6YSl14/h.:15908:0:99999:7:::31,针对student操作 设置密码为123456,然后用student登录自己修改密码[root@localhost ~]# echo 123456 | passwd --stdin student // echo:输出更改用户 student 的密码 。passwd: 所有的身份验证令牌已经成功更新。 [student@xobye ~]$ passwd // 修改密码更改用户 student 的密码 。为 student 更改 STRESS 密码。(当前)UNIX 密码:新的 密码: // 字母、数字、特殊符号重新输入新的 密码:passwd: 所有的身份验证令牌已经成功更新。 清空student的密码,查看/etc/shadow里面与student相关的内容[root@localhost ~]# passwd -d student //-d:清空用户密码清除用户的密码 student。passwd: 操作成功 [root@localhost ~]# cat /etc/shadow | grep studentstudent::16256:0:99999:7:::32、手动创建用户的过程 (禁止useradd)1)、/etc/passwd[root@localhost ~]# vim /etc/passwd // 存放用户账号的基本信息.. .. ..xobye:x:10006:10006::/home/xobye:/bin/bash // 每个用户记录一行,共7个字段,每字段以:分割 /etc/shadow[root@localhost ~]# vim /etc/shadow // 保存密码字串,有效期等信息.. .. ..xobye:!!:16256:0:99999:7::: // 共9个字段 /etc/group[root@localhost ~]# vim /etc/group // 存放组账号的基本信息.. .. ..xobye:x:10006: // 共4个字段 /etc/gshadow[root@localhost ~]# vim /etc/gshadow // 保存组账号的管理信息.. .. ..xobye:!:: // 共4个字段2)、/home/xxxx[root@localhost ~]# mkdir /home/xobye // 创建用户的家目录3)、/var/spool/mail/xxxx[root@localhost ~]# touch /var/spool/mail/xobye // 新建用户的接收邮件文件4)、/etc/skel/.*[root@localhost ~]# cp /etc/skel/.* /home/xobye/ // 用户的初始配置文件5)、权限[root@localhost ~]# chown xobye:xobye /home/xobye // 属主:属组[root@localhost ~]# chmod 700 /home/xobye/ // 700:权限[root@localhost ~]# ll -d /home/xobye/drwx------ 2 xobye xobye 4096 7月 6 16:37 /home/xobye/[root@localhost ~]# chown xobye:xobye /home/xobye/.* // 修改家目录下所有隐藏文件的的的归属[root@localhost ~]# ll -A /home/xobye/ 总用量 12-rw-r--r-- 1 xobye xobye 18 7月 6 16:37 .bash_logout-rw-r--r-- 1 xobye xobye 176 7月 6 16:37 .bash_profile-rw-r--r-- 1 xobye xobye 124 7月 6 16:37 .bashrc 33)为虚拟机添加一块80GB、SCSI接口的硬盘

34)划分2个20GB的主分区,剩余作为扩展分区[root@localhost 桌面]# fdisk /dev/sdb // 划分磁盘分区.. .. ..Command (m for help): n //n:新建分区Command action e extended p primary partition (1-4)p //创建主分区Partition number (1-4): 1 //First cylinder (1-10443, default 1): Using default value 1Last cylinder, +cylinders or +size{K,M,G} (1-10443, default 10443): +20G // 指定大小 Command (m for help): nCommand action e extended p primary partition (1-4)pPartition number (1-4): 2First cylinder (2613-10443, default 2613): Using default value 2613Last cylinder, +cylinders or +size{K,M,G} (2613-10443, default 10443): +20G Command (m for help): nCommand action e extended p primary partition (1-4)e // 创建扩展分区Partition number (1-4): 3First cylinder (5225-10443, default 5225): Using default value 5225Last cylinder, +cylinders or +size{K,M,G} (5225-10443, default 10443): // 默认:所有Using default value 1044335)新建2个逻辑分区,分别为2GB、10GBCommand (m for help): nCommand action l logical (5 or over) p primary partition (1-4)l // 创建逻辑分区First cylinder (5225-10443, default 5225): Using default value 5225Last cylinder, +cylinders or +size{K,M,G} (5225-10443, default 10443): +2G Command (m for help): nCommand action l logical (5 or over) p primary partition (1-4)lFirst cylinder (5487-10443, default 5487): Using default value 5487Last cylinder, +cylinders or +size{K,M,G} (5487-10443, default 10443): +10G36)将第1个逻辑分区的类型改为SWAP(ID 82)Command (m for help): t //t:变更分区类型Partition number (1-6): 5 Hex code (type L to list codes): 82 //82:SWAP类型Changed system type of partition 5 to 82 (Linux swap / Solaris)37)将第2个逻辑分区的类型改为VFAT(ID b)Command (m for help): tPartition number (1-6): 6Hex code (type L to list codes): b //b:或C,VFAT类型Changed system type of partition 6 to b (W95 FAT32)38)确认分区无误后,保存退出Command (m for help): w //w:保存退出The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: If you have created or modified any DOS 6.xpartitions, please see the fdisk manual page for additionalinformation.Syncing disks.39)使用partprobe识别新的分区表【最好是重启一次】[root@localhost ~]# partprobe // 重新识别40)将/dev/sdb1格式化成ext3分区[root@localhost ~]# mkfs.ext3 /dev/sdb1 // ext3:第3代扩展(Extended)文件系统.. .. ..41)将/dev/sdb6格式化成FAT32分区[root@localhost ~]# mkfs.vfat -F 32 /dev/sdb6 //-F:指定FAT位数mkfs.vfat 3.0.9 (31 Jan 2010)42)将/dev/sdb1挂载到/mnt/part1,在这个挂载目录新建一个file.txt文件和一个now的目录。[root@localhost ~]# mkdir /mnt/part1 // mkdir:新建文件夹[root@localhost ~]# mount /dev/sdb1 /mnt/part1/ // mount:挂载[root@localhost ~]# touch /mnt/part1/file.txt // touch:新建文件[root@localhost ~]# mkdir /mnt/part1/now43)将/dev/sdb1挂载到/mnt/part1[root@localhost ~]# mkdir /mnt/part6[root@localhost ~]# mount /dev/sdb6 /mnt/part644)分别卸载/dev/sdb1、/dev/sdb6[root@localhost ~]# umount /dev/sdb1 // umount:卸载[root@localhost ~]# umount /mnt/part6 薛标2014.07.06
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: