首页 文章 精选 留言 我的

精选列表

搜索[运维监控平台],共10000篇文章
优秀的个人博客,低调大师

Linux运维课程 第一阶段 重难点摘要(四)CISCO

一、路由器接口操作: 1、#show running-config查看接口 2、#interface fastethernet 0/1进入f0/1配置(0/1,0代表插槽1代表端口、若是s0/0/0,第一个0表示路由器本身) 3、#interface fastEthernet 0/1 #description tachingroute接口描述 4、#do show running-config do可让命令在其它模式运行 5、#int f0/0 #no shutdown 激活接口,接口默认是关闭状态 6、#int f0/0 #ip add 192.168.1.10 255.255.255.0给端口配IP #do sh int f0/0 7、#show controllers s1/0确认此端是DCE端 #int s1/0 #clock rate 64000 #do sh contro s1/0 #bandwidth 1000 时钟频率,在生成环境下不用配置,一般由服务器运营商进行控制,时钟频率只对串口连接的路由器有效,串口用于老式的广域网连接的,主要用于E1网络(带宽2.048Mbps),现已被光纤取代。如使用串口连接两台路由器,仅在DCE端配置(数据通信设备),DTE不需配置(数据终端设备)。 8、#copy running-config startup-config保存配置 #erase startup-config删除配置 #reload 二、查看路由器验证配置 1、#ping IP地址探测IP是否畅通 2、traceroute域名或IP测试路由路径 3、telnet IP或域名端口远程管理或探测端口 4、#clear counters f0/0清除接口的计数器 5、#show ip interface查看接口IP信息 6、#show ip interface brief查看所有接口的IP信息及状态 7、#show protocols查看所有接口上的协议 三、高级IOS操作 1、路由器启动顺序 (1)路由器执行POST开机自检,检查硬件以验证设备的所有组件,POST存储在ROM中,并从中运行; (2)bottstrap查找并加载IOS,它位于ROM中,用于启动时加载IOS,加载IOS的顺序是闪存-TFTP服务器-ROM,默认从闪存中加载IOS; (3)IOS接管启动过程,并在NVRAM中查找启动配置文件(startup-config),破解密码的关键是忽略startup-config; (4)如果在NVRAM中找到startup-config,复制到RAM中,生成running-config,加载登录界面,如没找到startup-config,则向所有接口发送广播,查找TFTP,用于配置路由器,若没找到TFTP,则启动用户交互设置对话模式进行初始化配置。 注:NVRAM非易失性随机存储器,指断电后仍能保存数据,用于保存永久生效的配置文件。 2、破解密码 (1)console线连接路由器,开机60秒后按ctrl+break,中断启动过程,进入rom-moritor模式,此时提示符为rommon 1> (2)修改寄存器的值,>config 0x2142 (3)重启,>reset (4)#copy startup-config running-config #enable secret lamp (5)#config-register 0x2102 #copy run start 四、思科发现协议CDP(CISCO discovery protocol) 1、#show cdp #show cdp interface #cdp timer 60 #cdp holdtime 180获取定时器和保存时间信息 #cdp run激活CDP 2、#show cdp neighbors 收集邻居信息 #showcdp entry * #showcdp entry * protocol #showcdp entry * version 五、路由器备份、升级和恢复 1、#copy tftp: flash: #copy flash: tftp: 路由器的存储器主要有: ROM:一分IOS附本; RAM:IOS将随机访问存储器分成共享和主存,主要用来存储运行中的路由配置和与路由器协议有关的IOS数据结构; FLASH:存储IOS软件映像,闪存是可擦除内存,能用IOS的新版本覆写; NVRAM:存储系统的配置文件。 本文转自 chaijowin 51CTO博客,原文链接:http://blog.51cto.com/jowin/1634858,如需转载请自行联系原作者

优秀的个人博客,低调大师

全新Linux+Python高端运维班-Linux用户创建及权限管理

第三周作业内容: 1、列出当前系统上所有已经登录的用户的用户名,注意:同一个用户登录多次,则只显示一次即可。 1 2 3 4 [root@liu~] #who|cut-d''-f1|sort-u centos liu root 2、取出最后登录到当前系统的用户的相关信息。 1 2 3 4 5 6 第一种方式: [root@liu~] #last|head-n1 liutty8:2SunAug2110:26stilllogged in 第二种方式: [root@liu~] #who|tail-n1 liutty82016-08-2110:26(:2) 3、取出当前系统上被用户当作其默认shell的最多的那个shell。 1 2 [root@liuljohn] #cut-d:-f7/etc/passwd|uniq-c|sort-n|tail-n1 25 /sbin/nologin Note:/etc/passwd name:password:UID:GID:GECOS:directory:shell 4、将/etc/passwd 中的第三个字段数值最大的后10个用户的信息全部改为大写后保存至/tmp/maxusers.txt文件中。 1 2 3 4 5 6 7 8 9 10 11 12 [root@liuljohn] #sort-t:-k3-n/etc/passwd|tail-10|tr'a-z''A-Z'>/tmp/maxusers.txt [root@liuljohn] #cat/tmp/maxusers.txt RTKIT:X:499:497:REALTIMEKIT: /PROC : /SBIN/NOLOGIN LIU:X:500:500:LIUJIAN: /HOME/LIU : /BIN/BASH BASH:X:501:501:: /HOME/BASH : /BIN/BASH BASHER:X:502:502:: /HOME/BASHER : /BIN/BASH TESTBASH:X:503:503:: /HOME/TESTBASH : /BIN/BASH NOLOGIN:X:504:504:: /HOME/NOLOGIN : /SBIN/NOLOGIN USER1:X:505:505:: /HOME/USER1 : /BIN/BASH CENTOS:X:506:506:: /HOME/CENTOS : /BIN/BASH USERADD1:X:507:507:: /HOME/USERADD1 : /BIN/BASH NFSNOBODY:X:65534:65534:ANONYMOUSNFSUSER: /VAR/LIB/NFS : /SBIN/NOLOGIN 5、取出当前主机的IP地址,提示:对ifconfig命令的结果进行切分。 1 2 3 4 5 6 7 8 9 10 11 12 [root@liuljohn] #ifconfigeth1 eth1Linkencap:EthernetHWaddr00:0C:29:45:CC:5E inetaddr:192.168.188.21Bcast:192.168.188.255Mask:255.255.255.0 inet6addr:fe80::20c:29ff:fe45:cc5e /64 Scope:Link UPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1 RXpackets:5871errors:0dropped:0overruns:0frame:0 TXpackets:2355errors:0dropped:0overruns:0carrier:0 collisions:0txqueuelen:1000 RXbytes:486015(474.6KiB)TXbytes:259218(253.1KiB) Interrupt:19Baseaddress:0x2000 [root@liuljohn] #ifconfigeth1|head-n2|tail-n1|cut-d:-f2|cut-d''-f1 192.168.188.21 6、列出/etc目录下所有以.conf结尾的文件的文件名,并将其名字转换为大写后保存至/tmp/etc.conf文件中。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [root@liuljohn] #ls/etc/*.conf|tr'a-z''A-Z'>/tmp/etc.test [root@liuljohn] #cat/tmp/etc.test /ETC/ASOUND .CONF /ETC/AUTOFS_LDAP_AUTH .CONF /ETC/CAS .CONF /ETC/DNSMASQ .CONF /ETC/DRACUT .CONF /ETC/FPRINTD .CONF /ETC/GAI .CONF /ETC/GRUB .CONF /ETC/GSSAPI_MECH .CONF . . . 7、显示/var目录下一级子目录或文件的总个数。 1 2 [root@liuljohn] #ls/var|wc-l 21 8、取出/etc/group文件中第三个字段数值最小的10个组的名字。 1 2 3 4 5 6 7 8 9 10 11 [root@liuljohn] #sort-t:-k3-n/etc/group|head-10|cut-d:-f1 root bin daemon sys adm tty disk lp mem kmem 9、将/etc/fstab和/etc/issue文件的内容合并为同一个内容后保存至/tmp/etc.test文件中。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 [root@liuljohn] #cat/etc/fstab/etc/issue>/tmp/etc.test [root@liuljohn] #cat/tmp/etc.test # #/etc/fstab #CreatedbyanacondaonThuFeb1205:17:122015 # #Accessiblefilesystems,byreference,aremaintainedunder'/dev/disk' #Seemanpagesfstab(5),findfs(8),mount(8)and/orblkid(8)formoreinfo # UUID=3fcabd0f-e9fb-4618-918d-c9e004fe6a59/ext4defaults11 UUID=234cc62b-7746-477d-ad58-8fb2448b9788 /boot ext3defaults12 UUID=b2c5da64-87b4-44c0-8864-f4a006b824fcswapswapdefaults00 tmpfs /dev/shm tmpfsdefaults00 devpts /dev/pts devptsgid=5,mode=62000 sysfs /sys sysfsdefaults00 proc /proc procdefaults00 CentOSrelease6.5(Final) Kernel\ronan\m 10、请总结描述用户和组管理类命令的使用方法并完成以下练习: (1)、创建组distro,其GID为2016; 1 2 3 [root@liuljohn] #groupadd-g2016distro [root@liuljohn] #tail-1/etc/group distro:x:2016: (2)、创建用户mandriva, 其ID号为1005;基本组为distro; 1 2 3 [root@liuljohn] #useradd-u1005-g2016mandirva [root@liuljohn] #idmandirva uid=1005(mandirva)gid=2016(distro)组=2016(distro) (3)、创建用户mageia,其ID号为1100,家目录为/home/linux; 1 2 3 4 5 [root@liuljohn] #useradd-u1100-d/home/linuxmageia [root@liuljohn] #idmageia uid=1100(mageia)gid=1100(mageia)组=1100(mageia) [root@liuljohn] #tail-1/etc/passwd mageia:x:1100:1100:: /home/linux : /bin/bash (4)、给用户mageia添加密码,密码为mageedu; 1 2 3 [root@liuljohn] #echo"mageedu"|passwd--stdinmageia 更改用户mageia的密码。 passwd :所有的身份验证令牌已经成功更新。 (5)、删除mandriva,但保留其家目录; 1 2 3 4 5 [root@liuljohn] #userdelmandirva [root@liuljohn] #ls/home/ bash bashercentoslinuxliumandirvanologintestbashuser1useradd1 [root@liuljohn] #idmandirva id :mandirva:无此用户 (6)、创建用户slackware,其ID号为2002,基本组为distro,附加组peguin; 1 2 3 4 5 6 [root@liuljohn] #groupaddpeguin [root@liuljohn] #useradd-u2002-gdistro-Gpeguinslackware [root@liuljohn] #tail-1/etc/passwd slackware:x:2002:2016:: /home/slackware : /bin/bash [root@liuljohn] #idslackware uid=2002(slackware)gid=2016(distro)组=2016(distro),2017(peguin) (7)、修改slackware的默认shell为/bin/tcsh; 1 2 3 [root@liuljohn] #usermod-s/bin/tcshslackware [root@liuljohn] #tail-1/etc/passwd slackware:x:2002:2016:: /home/slackware : /bin/tcsh (8)、为用户slackware新增附加组admins; 1 2 3 4 5 6 7 8 9 10 11 [root@liuljohn] #sort-t:-k3-n/etc/group|head-10|cut-d:-f1 root bin daemon sys adm tty disk lp mem kmem (9)、为slackware添加密码,且要求密码最短使用期限为3天,最长为180天,警告为3天; 1 2 3 4 5 [root@liuljohn] #passwd-n3-x180-w3slackware 调整用户密码老化数据slackware。 passwd :操作成功 [root@liuljohn] #tail-1/etc/shadow slackware:!!:17034:3:180:3::: (10)、添加用户openstack,其ID号为3003, 基本组为clouds,附加组为peguin和nova; 1 2 3 4 5 [root@liuljohn] #groupaddclouds [root@liuljohn] #groupaddnova [root@liuljohn] #useradd-u3003-gclouds-Gpeguin,novaopenstack [root@liuljohn] #idopenstack uid=3003(openstack)gid=2019(clouds)组=2019(clouds),2017(peguin),2020(nova) (11)、添加系统用户mysql,要求其shell为/sbin/nologin; 1 2 3 [root@liuljohn] #useradd-s/sbin/nologinmysql [root@liuljohn] #tail-1/etc/passwd mysql:x:3004:3004:: /home/mysql : /sbin/nologin (12)、使用echo命令,非交互式为openstack添加密码。 1 2 3 4 [root@liuljohn] #echo"openstack"|passwd--stdinopenstack 更改用户openstack的密码。 passwd :所有的身份验证令牌已经成功更新。 [root@liuljohn] # 本文转自 ljohnmail 51CTO博客,原文链接:http://blog.51cto.com/ljohn/1840868,如需转载请自行联系原作者

优秀的个人博客,低调大师

《Oracle高性能自动化运维》一一3.1 Redo功能用途

3.1 Redo功能用途Redo是Oracle数据库最重要的组成部分之一,其主要功能有:数据库恢复(Recovery):数据库出现异常故障时,可以利用Redo实现数据库级的恢复;介质恢复(Media Recovery):数据库物理介质异常(丢失、坏块等情况)时,可以利用Redo进行介质恢复;实例恢复(Instance Recovery):数据库实例异常崩溃时,可以借助Redo自动进行实例恢复;日志挖掘(Log Miner):数据库业务数据异常(误删除数据等情况)时,可以借助日志挖掘还原业务数据;流复制(Stream):可以借助Redo流复制实现数据同步功能;数据安全卫士(DataGuard):通过将主库(Master)节点的Redo传递、应用到从库(Standby),实现数据库架构层面的高可用性以及读写分离;数据同步(Golden

优秀的个人博客,低调大师

全新Linux+Python高端运维班第三次作业

1、找出/etc/rc.d/init.d/functions文件中某单词后面跟一组小括号的行,形如:hello(); [root@tom~]#grep-E-o"[_[:alpha:]]+\(\)"/etc/rc.d/init.d/functions fstab_decode_str() checkpid() __readlink() __fgrep() __kill_pids_term_kill_checkpids() __kill_pids_term_kill() __umount_loop() __source_netdevs_fstab() __source_netdevs_mtab() __umount_loopback_loop() __find_mounts() __pids_var_run() __pids_pidof() daemon() killproc() pidfileofproc() pidofproc() status() echo_success() echo_failure() echo_passed() echo_warning() update_boot_stage() success() failure() passed() warning() action() action_silent() strstr() confirm() get_numeric_dev() is_ignored_file() is_true() is_false() apply_sysctl() key_is_random() find_crypto_mount_point() init_crypto() 2、使用echo命令输出一个绝对路径,使用grep取出其基名; 扩展:取出其路径名 [root@tom~]#echo/etc/sysconfig/network-scripts/ifcfg-eth0|grep-E-o"[^/]+$" ifcfg-eth0 #extended# [root@tom~]#echo/etc/sysconfig/network-scripts/ifcfg-eth0|grep-E-o"/.*/" /etc/sysconfig/network-scripts/ 3、找出ifconfig命令结果中的1-255之间数字; [root@tom~]#ifconfig eth0Linkencap:EthernetHWaddr08:00:27:DA:EF:CA inetaddr:172.18.11.121Bcast:172.18.11.127Mask:255.255.255.128 inet6addr:fe80::a00:27ff:feda:efca/64Scope:Link UPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1 RXpackets:21714errors:0dropped:0overruns:0frame:0 TXpackets:915errors:0dropped:0overruns:0carrier:0 collisions:0txqueuelen:1000 RXbytes:1479394(1.4MiB)TXbytes:133705(130.5KiB) loLinkencap:LocalLoopback inetaddr:127.0.0.1Mask:255.0.0.0 inet6addr:::1/128Scope:Host UPLOOPBACKRUNNINGMTU:65536Metric:1 RXpackets:0errors:0dropped:0overruns:0frame:0 TXpackets:0errors:0dropped:0overruns:0carrier:0 collisions:0txqueuelen:0 RXbytes:0(0.0b)TXbytes:0(0.0b) [root@tom~]#ifconfig|egrep-o"\<([1-9]|[0-9]{2}|1[0-9]{2}|2[0-5]{2})\>" 08 00 27 172 18 11 121 172 18 11 127 255 255 255 128 64 1 2 1 224 2 127 1 255 1 128 1 4、查找当前系统上没有属主或属组的文件; 进一步:查找当前系统上没有属主或属组,且最近3天内曾被访问过的文件或目录; [root@tom~]#find/\(-nouser-o-nogroup\)-a-ls|wc-l find:`/proc/21565/task/21565/fd/5':Nosuchfileordirectory find:`/proc/21565/task/21565/fd/5':Nosuchfileordirectory find:`/proc/21565/task/21565/fdinfo/5':Nosuchfileordirectory find:`/proc/21565/task/21565/fdinfo/5':Nosuchfileordirectory find:`/proc/21565/fd/5':Nosuchfileordirectory find:`/proc/21565/fd/5':Nosuchfileordirectory find:`/proc/21565/fdinfo/5':Nosuchfileordirectory find:`/proc/21565/fdinfo/5':Nosuchfileordirectory 1842 #Nextstep# [root@tom~]#find/\(-nouser-o-nogroup\)-a-atime-3-ls|wc-l find:`/proc/21574/task/21574/fd/5':Nosuchfileordirectory find:`/proc/21574/task/21574/fdinfo/5':Nosuchfileordirectory find:`/proc/21574/fd/5':Nosuchfileordirectory find:`/proc/21574/fdinfo/5':Nosuchfileordirectory 214 5、查找/etc目录下大于1M,且类型为普通文件的所有文件; [root@tom~]#find/etc-size+1M-typef-execls-lh{}\; -rw-r--r--.1rootroot8.1MDec1616:43/etc/selinux/targeted/modules/active/policy.kern -rw-r--r--.1rootroot8.1MDec1616:43/etc/selinux/targeted/policy/policy.24 -rw-r--r--.1rootroot2.2MDec1616:10/etc/gconf/gconf.xml.defaults/%gconf-tree.xml 6、查找/etc/init.d/目录下,所有用户都有执行权限,且其它用户有写权限的文件; [root@tom~]#find/etc/init.d/-perm113 [root@tom~]#ls-lh/etc/init.d/ total440K -rwxr-xr-x.1rootroot1.3KMay122016abrt-ccpp -rwxr-xr-x.1rootroot1.6KMay122016abrtd -rwxr-xr-x.1rootroot1.7KMay122016abrt-oops -rwxr-xr-x.1rootroot1.8KFeb172016acpid -rwxr-xr-x.1rootroot2.1KFeb202015atd -rwxr-xr-x.1rootroot3.5KMay112016auditd -rwxr-xr-x.1rootroot4.0KJul122016autofs -r-xr-xr-x.1rootroot1.4KAug2402:37blk-availability -rwxr-xr-x.1rootroot710Nov112010bluetooth -rwxr-xr-x.1rootroot2.1KMay92016certmonger -rwxr-xr-x.1rootroot12KJul242015cpuspeed -rwxr-xr-x.1rootroot2.8KAug2402:36crond -rwxr-xr-x.1rootroot3.0KMay112016cups -rwxr-xr-x.1rootroot1.7KMay112016dnsmasq -rwxr-xr-x.1rootroot3.2KJul92013firstboot -rw-r--r--.1rootroot25KApr122016functions -rwxr-xr-x.1rootroot1.8KOct152014haldaemon -rwxr-xr-x.1rootroot5.9KApr122016halt -rwxr-xr-x.1rootroot2.0KNov1907:49htcacheclean -rwxr-xr-x.1rootroot3.5KNov1907:49httpd -rwxr-xr-x.1rootroot11KJul242015ip6tables -rwxr-xr-x.1rootroot6.6KMay112016ipsec -rwxr-xr-x.1rootroot11KJul242015iptables -rwxr-xr-x.1rootroot1.9KFeb22016irqbalance -rwxr-xr-x.1rootroot21KNov1823:19kdump -rwxr-xr-x.1rootroot652Apr122016killall -r-xr-xr-x.1rootroot2.1KAug2402:37lvm2-lvmetad -r-xr-xr-x.1rootroot3.0KAug2402:37lvm2-monitor -rwxr-xr-x.1rootroot2.6KJun212016mdmonitor -rwxr-xr-x.1rootroot2.2KApr222015messagebus -rwxr-xr-x.1rootroot6.9KMay112016mysqld -rwxr-xr-x.1rootroot3.0KApr122016netconsole -rwxr-xr-x.1rootroot5.2KApr122016netfs -rwxr-xr-x.1rootroot6.3KApr122016network -rwxr-xr-x.1rootroot2.2KMay112016NetworkManager -rwxr-xr-x.1rootroot6.8KOct504:27nfs -rwxr-xr-x.1rootroot3.5KOct504:27nfslock -rwxr-xr-x.1rootroot1.9KMay32016ntpd -rwxr-xr-x.1rootroot2.0KMay32016ntpdate -rwxr-xr-x.1rootroot2.3KMay112016oddjobd -rwxr-xr-x.1rootroot2.5KMay312010openct -rwxr-xr-x.1rootroot2.2KJul242015pcscd -rwxr-xr-x.1rootroot2.0KMay112016portreserve -rwxr-xr-x.1rootroot3.9KNov102015postfix -rwxr-xr-x.1rootroot9.5KNov522:08postgresql-9.2 -rwxr-xr-x.1rootroot1.7KMay112016pppoe-server -rwxr-xr-x.1rootroot1.6KJul172012psacct -rwxr-xr-x.1rootroot2.0KJan72015quota_nld -rwxr-xr-x.1rootroot1.5KNov132015rdisc -rwxr-xr-x.1rootroot1.8KNov1823:30restorecond -rwxr-xr-x.1rootroot1.8KSep222015rngd -rwxr-xr-x.1rootroot2.1KMay112016rpcbind -rwxr-xr-x.1rootroot2.5KOct504:27rpcgssd -rwxr-xr-x.1rootroot2.3KOct504:27rpcidmapd -rwxr-xr-x.1rootroot2.5KOct504:27rpcsvcgssd -rwxr-xr-x.1rootroot2.0KDec102014rsyslog -rwxr-xr-x.1rootroot1.7KNov1823:30sandbox -rwxr-xr-x.1rootroot2.1KFeb272015saslauthd -rwxr-xr-x.1rootroot647Apr122016single -rwxr-xr-x.1rootroot3.0KFeb222013smartd -rwxr-xr-x.1rootroot2.2KAug2402:47snmpd -rwxr-xr-x.1rootroot1.7KAug2402:47snmptrapd -rwxr-xr-x.1rootroot2.5KMay112016spice-vdagentd -rwxr-xr-x.1rootroot4.6KMay122016sshd -rwxr-xr-x.1rootroot2.7KJul122016sssd -rwxr-xr-x.1rootroot1.2KMay112016sysstat -rwxr-xr-x.1rootroot2.3KSep622:51udev-post -rwxr-xr-x.1rootroot16KNov616:42vboxadd -rwxr-xr-x.1rootroot3.0KNov616:43vboxadd-service -rwxr-xr-x.1rootroot21KNov616:43vboxadd-x11 -rwxr-xr-x.1rootroot3.4KMay112016vsftpd -rwxr-xr-x.1rootroot1.7KFeb222013wdaemon -rwxr-xr-x.1rootroot1.6KAug2402:58winbind -rwxr-xr-x.1rootroot1.9KNov1822:26wpa_supplicant -rwxr-xr-x.1rootroot5.0KMay112016ypbind 7、查找/etc目录下最近一周内其内容被修改过,且不属于root或hadoop的文件; [root@tom~]#find/etc-mtime-7-a-not\(-userroot-o-userhadoop\) [root@tom~]# 8、复制/etc/rc.d/rc.sysinit文件至/tmp目录,将/tmp/rc.sysinit文件中的以至少一个空白字符开头的行的行首加#; [root@tom~]#cp/etc/rc.d/rc.sysinit/tmp [root@tom~]#ls-lh/tmp total24K drwx------.2rootroot4.0KDec1119:18pulse-0QUeAoK4lJM6 -rwxr-xr-x.1rootroot20KFeb1217:07rc.sysinit [root@tom~]#head-n20/tmp/rc.sysinit #!/bin/bash # #/etc/rc.d/rc.sysinit-runonceatboottime # #TakeninpartfromMiquelvanSmoorenburg'sbcheckrc. # HOSTNAME=$(/bin/hostname) set-m if[-f/etc/sysconfig/network];then ./etc/sysconfig/network fi if[-z"$HOSTNAME"-o"$HOSTNAME"="(none)"];then HOSTNAME=localhost fi if[!-e/proc/mounts];then mount-n-tproc/proc/proc [root@tom~]#vim/tmp/rc.sysinit #在末行模式下输入: :%s@^[[:space:]]\+@#&@g [root@tom~]#head-n20/tmp/rc.sysinit #!/bin/bash # #/etc/rc.d/rc.sysinit-runonceatboottime # #TakeninpartfromMiquelvanSmoorenburg'sbcheckrc. # HOSTNAME=$(/bin/hostname) set-m if[-f/etc/sysconfig/network];then #./etc/sysconfig/network fi if[-z"$HOSTNAME"-o"$HOSTNAME"="(none)"];then #HOSTNAME=localhost fi if[!-e/proc/mounts];then #mount-n-tproc/proc/proc [root@tom~]#head-n20/tmp/rc.sysinit #!/bin/bash # /etc/rc.d/rc.sysinit-runonceatboottime # TakeninpartfromMiquelvanSmoorenburg'sbcheckrc. # HOSTNAME=$(/bin/hostname) set-m if[-f/etc/sysconfig/network];then ./etc/sysconfig/network fi if[-z"$HOSTNAME"-o"$HOSTNAME"="(none)"];then HOSTNAME=localhost fi if[!-e/proc/mounts];then mount-n-tproc/proc/proc 9、删除/tmp/rc.sysinit文件中的以#开头,且后面跟了至少一个空白字符的行行的#和空白字符 [root@tom~]#head-n20/tmp/rc.sysinit #!/bin/bash # #/etc/rc.d/rc.sysinit-runonceatboottime # #TakeninpartfromMiquelvanSmoorenburg'sbcheckrc. # HOSTNAME=$(/bin/hostname) set-m if[-f/etc/sysconfig/network];then #./etc/sysconfig/network fi if[-z"$HOSTNAME"-o"$HOSTNAME"="(none)"];then #HOSTNAME=localhost fi if[!-e/proc/mounts];then #mount-n-tproc/proc/proc [root@tom~]#vim/tmp/rc.sysinit #在末行模式下输入: :%s@^#[[:space:]]\+@@g [root@tom~]#head-n20/tmp/rc.sysinit #!/bin/bash # /etc/rc.d/rc.sysinit-runonceatboottime # TakeninpartfromMiquelvanSmoorenburg'sbcheckrc. # HOSTNAME=$(/bin/hostname) set-m if[-f/etc/sysconfig/network];then ./etc/sysconfig/network fi if[-z"$HOSTNAME"-o"$HOSTNAME"="(none)"];then HOSTNAME=localhost fi if[!-e/proc/mounts];then mount-n-tproc/proc/proc 10、将/etc/yum.repos.d/CentOS-Media.repo文件中所有的enabled=0或gpgcheck=0的最后的0修改为1; [root@tom~]#cat/etc/yum.repos.d/CentOS-Media.repo #CentOS-Media.repo # #ThisrepocanbeusedwithmountedDVDmedia,verifythemountpointfor #CentOS-6.Youcanusethisrepoandyumtoinstallitemsdirectlyoffthe #DVDISOthatwerelease. # #Tousethisrepo,putinyourDVDanduseitwiththeotherrepostoo: #yum--enablerepo=c6-media[command] # #orforONLYthemediarepo,dothis: # #yum--disablerepo=\*--enablerepo=c6-media[command] [c6-media] name=CentOS-$releasever-Media baseurl=file:///media/CentOS/ file:///media/cdrom/ file:///media/cdrecorder/ gpgcheck=1 enabled=0 gpgkey= [root@tom~]#vi/etc/yum.repos.d/CentOS-Media.repo #在末行模式下输入: :%s/\(enabled\|gpgcheck\)=0/\1=1/g [root@tom~]#cat/etc/yum.repos.d/CentOS-Media.repo #CentOS-Media.repo # #ThisrepocanbeusedwithmountedDVDmedia,verifythemountpointfor #CentOS-6.Youcanusethisrepoandyumtoinstallitemsdirectlyoffthe #DVDISOthatwerelease. # #Tousethisrepo,putinyourDVDanduseitwiththeotherrepostoo: #yum--enablerepo=c6-media[command] # #orforONLYthemediarepo,dothis: # #yum--disablerepo=\*--enablerepo=c6-media[command] [c6-media] name=CentOS-$releasever-Media baseurl=file:///media/CentOS/ file:///media/cdrom/ file:///media/cdrecorder/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 11、每周2,4,6备份/var/log/messages文件至/backup/messages_logs/目录中,保存的文件名形如messages-20161202 [root@tom~]#crontab-e nocrontabforroot-usinganemptyone crontab:installingnewcrontab [root@tom~]#crontab-l #Backup/var/log/messagesto/backup/messages_logs/ateveryweek2,4,6--sam ****2,4,6cp/var/log/messagesbackup/messages_logs/messages-$(date+%Y%m%D) 12、每天每两小时取当前系统/proc/meminfo文件中的所有以S开头的信息至/stats/memory.txt文件中 [root@tom~]#crontab-e crontab:installingnewcrontab [root@tom~]#crontab-l #Backup/var/log/messagesto/backup/messages_logs/ateveryweek2,4,6--sam ****2,4,6cp/var/log/messagesbackup/messages_logs/messages-$(date+%Y%m%D) #每天每两小时取当前系统/proc/meminfo文件中的所有以S开头的信息至/stats/memory.txt文件中 **/2***cat/proc/meminfo|grep"^S">>/stats/memory.txt 13、写一个脚本创建10用户user10-user19;密码同用户名; [root@tombin]#vimuadd #!/bin/bash #adduser10-user19. for((i=10;i<=19;i++));do iduser$i&>/dev/null&&exit0||useradduser$i&&echo"user$i"|passwd--stdinuser$i done [root@tombin]#ll total4 -rw-r--r--.1rootroot155Feb1218:02uadd [root@tombin]#chmod755uadd [root@tombin]#ll total4 -rwxr-xr-x.1rootroot155Feb1218:02uadd [root@tombin]#uadd Changingpasswordforuseruser10. passwd:allauthenticationtokensupdatedsuccessfully. Changingpasswordforuseruser11. passwd:allauthenticationtokensupdatedsuccessfully. Changingpasswordforuseruser12. passwd:allauthenticationtokensupdatedsuccessfully. Changingpasswordforuseruser13. passwd:allauthenticationtokensupdatedsuccessfully. Changingpasswordforuseruser14. passwd:allauthenticationtokensupdatedsuccessfully. Changingpasswordforuseruser15. passwd:allauthenticationtokensupdatedsuccessfully. Changingpasswordforuseruser16. passwd:allauthenticationtokensupdatedsuccessfully. Changingpasswordforuseruser17. passwd:allauthenticationtokensupdatedsuccessfully. Changingpasswordforuseruser18. passwd:allauthenticationtokensupdatedsuccessfully. Changingpasswordforuseruser19. passwd:allauthenticationtokensupdatedsuccessfully. [root@tombin]#tail/etc/passwd user10:x:3009:3009::/home/user10:/bin/bash user11:x:3010:3010::/home/user11:/bin/bash user12:x:3011:3011::/home/user12:/bin/bash user13:x:3012:3012::/home/user13:/bin/bash user14:x:3013:3013::/home/user14:/bin/bash user15:x:3014:3014::/home/user15:/bin/bash user16:x:3015:3015::/home/user16:/bin/bash user17:x:3016:3016::/home/user17:/bin/bash user18:x:3017:3017::/home/user18:/bin/bash user19:x:3018:3018::/home/user19:/bin/bash

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册