TXT

linux command for root

By Denise Elliott,2014-10-16 17:26
7 views 0
linux command for root

原则1root用户不可以直接运行或者执行普通用户的执行文件等;否者会造成普通用户没

    有权限继续操作?

    原则2;以下命令不得在服务器随意执行;练习只能在虚拟机?

[root@DBSERVER databack]# history root身份登录系统;执行history查看历史执

    行命令;

     1 ifconfig\

     2 ifconfig

     3 ifconfig\

     4 ifconfig

     5 \

     6 ifup eth1 启用eth1这块网卡

     7 ifconfig eth1

     8 ifdown eth1

     9 ifup eth1

     10 service network restart 重新启动网络

     11 ipconfig eth1

     12 ifconfig eth1

     13 cd /etc/sysconfig/network-scripts/ 网卡配置文件路径

     14 vi ifcfg-eth1 编辑eth1网卡配置文件

     15 service network restart

     16 ifcofnig

     17 ifconfig eth1

     18 ping 192.168.8.1 ping网关测试

     19 ifconfig\

     20 ifconfig

     21 ifconfig

     22 vi eth0

     23 vi ifcfg-eth0

     24 service network restart

     25 cd /etc/ssh

     26 vi sshd_config

     27 service sshd restart 重新启动SSHD这个服务器;一般在修改SSH参数需要重

    新启动

     28 iptables -L

     29 ping 192.168.8.1

     30 exit\

     31 exit\

     32 exit

     33 cd /etc/ssh

     34 ls

     35 cd ../sysconfig

     36 vi iptables 编辑防火墙规则

     37 ls

     38 cd ../ssh

     39 vi sshd_config

     40 service sshd restart services iptables restart service network restart

     41 service iptables restart

     42 iptables _L

     43 iptables -0L

     44 iptables -L 查看生效的防火墙规则

     45 pign 192.168.8.1

     46 ping 192.168.8.1

     47 exit

     48 exigt

     49 exit

     50 su - sybase 切换到sybase用户;并执行该用户环境变量

     51 reboot

     52 more /proc/cpuinfo 查看CPU信息

     53 free 查看内存信息

     54 fdisk -l 查看硬盘分区信息

     55 more /etc/sysctl.conf 查看内核参数配置文件

     56 freee

     57 free

     58 vi /etc/sysctl.conf

     59 ls

     60 vi /etc/sysctl.conf

     61 more /etc/sysctl.conf

     62 sysctl -w 生效内核参数配置值

     63 sysctl -w

     64 sysctl -w

     65 sysctl -p

     66 ipcs -L

     67 ipcs -l

     68 vi /etc/sysctl.conf

     69 sysctl -w

     70 sysctl -p

     71 fdisk -l

     72 fdisk /dev/sda

     73 fdisk -l

     74 cd /

     75 ll

     76 chown sybase.sybase /opt 修改文件所有者

     77 ll

     78 ls

     79 cd

     80 ;s

     81 ls

     82 cd /home

     83 ls

     84 mkdir sybback

     85 ipcs -L

     86 ipcs -l

     87 fdisk -l

     88 fdisk /dev/sda

     89 fdisk -l

     90 df -h 查看磁盘空间使用情况

     91 pvscan

     92 usermod -G disk sybase 将用户添加到disk

     93 id sybase 查看用户信息

     94 pvcreate -f -y /dev/sda/sda4 创建物理卷

     95 vgcreate sybasevg /dev/sda/sda4 创建卷组

     96 lvcreate -L 300G -n lvsybback sybasevg 创建逻辑卷

     97 lvcreate -L 10G -n lvdustodata01 sybasevg

     98 lvcreate -L 10G -n lvdustodata02 sybasevg

     99 lvcreate -L 10G -n lvdustolog01 sybasevg

     100 lvcreate -L 10G -n lvdustolog02 sybasevg

     101 lvcreate -L 10G -n lvtestdata01 sybasevg

     102 lvcreate -L 10G -n lvtestdata02 sybasevg

     103 lvcreate -L 10G -n lvtestlog01 sybasevg

     104 lvcreate -L 10G -n lvtestlog02 sybasevg

     105 lvcreate -L 4G -n lvtempdata01 sybasevg

     106 lvcreate -L 4G -n lvtemplog01 sybasevg

     107 lvcreate -L 256M -n lvsecudata01 sybasevg

     108 lvcreate -L 256M -n lvsecudata02 sybasevg

     109 lvcreate -L 256M -n lvseculog01 sybasevg

     110 lvcreate -L 10G -n lvauddata01 sybasevg

     111 lvcreate -L 2G -n lvaudlog01 sybasevg

     112 chown -R sybase.sybase /dev/sybasevg

     113 chown -h sybase.sybase /dev/sybasevg/*

     114 ls

     115 fdisk -l

     116 fdisk -l

     117 pvcreate -f -y /dev/sda4

     118 vgcreate sybasevg /dev/sda4

     119 lvcreate -L 300G -n lvsybback sybasevg

     120 lvcreate -L 10G -n lvdustodata01 sybasevg

     121 lvcreate -L 10G -n lvdustodata02 sybasevg

     122 lvcreate -L 10G -n lvdustolog01 sybasevg

     123 lvcreate -L 10G -n lvdustolog02 sybasevg

     124 lvcreate -L 10G -n lvtestdata01 sybasevg

     125 lvcreate -L 10G -n lvtestdata02 sybasevg

     126 lvcreate -L 10G -n lvtestlog01 sybasevg

     127 lvcreate -L 10G -n lvtestlog02 sybasevg

     128 lvcreate -L 4G -n lvtempdata01 sybasevg

     129 lvcreate -L 4G -n lvtemplog01 sybasevg

     130 lvcreate -L 256M -n lvsecudata01 sybasevg

     131 lvcreate -L 256M -n lvsecudata02 sybasevg

     132 lvcreate -L 256M -n lvseculog01 sybasevg

     133 lvcreate -L 10G -n lvauddata01 sybasevg

     134 lvcreate -L 2G -n lvaudlog01 sybasevg

     135 chown -R sybase.sybase /dev/sybasevg

     136 chown -h sybase.sybase /dev/sybasevg/*

     137 ls

     138 lvscan 查看逻辑卷

     139 mkfs -t ext3 /dev/sybasevg/lvsybback 格式化逻辑卷

     140 mount -t ext3 /dev/sybasevg/lvsybback /home/sybback 挂在逻辑卷到系统

     141 df -h

     142 e2label /dev/sybasevg/lvsybback SYBBACK 增加逻辑卷卷标

     143 e2label /dev/sybasevg/lvsybback

     144 vi /etc/fstab 修改系统分区挂在表

     145 ls

     146 more /etc/fstab

     147 e2label /dev/sybasevg/lvsybback

     148 ls

     149 ls

     150 ifconfig

     151 cd /home/sybback

     152 ls

     153 mkdir databack

     154 chown sybase.sybase databack

     155 ll

     156 vi /etc/hosts

     157 cd

     158 chown sybase.sybase /dev/sybasevg 修改用户权限

     159 chown -h sybase.sybase /dev/sybasevg/* 修改文件的用户权限

     160 cd /etc/init.d/

     161 ls

     162 vi sybased

     163 chmod 755 sybased

     164 chkconfig --add sybased 向系统增加sybased服务

     165 chkconfig --list sybased 查看系统自启动服务

     166 showserver

     167 crontab -e 编辑当前用户的计划任务

     168 ntpdate time.windows.com; 更新系统时间

     169 ifconfig 查看网卡配置信息

     170 ping 192.168.8.1

     171 nslookup 域名解析测试

     172 cd

     173 vi /etc/resolv.conf DNS配置文件

     174 ls

     175 crontab -l

     176 ntpdate time.windows.com

     177 ntpdate ntp.fudan.edu.cn

     178 ping www.baidu.com

     179 nslookup

     180 ifconfig

     181 su - sybase

     182 su - sybase

     183 vmstat 1

     184 su - sybase

     185 lvscan

     186 su - sybase

     187 ping baidu.com

     188 more /etc/resolv.conf

     189 ping 192.168.8.1

     190 ping 61.153.177.196

     191 su - sybase

     192 ping 60.12.44.26

     193 ping 122.228.144.109

     194 ping 192.168.8.1

     195 reboot

     196 ping 192.168.8.1

     197 ping 61.153.177.196

     198 ping baidu.com

     199 showserver

     200 cd /etc/init.d

     201 ls

     202 more sybased

     203 vi sybased

     204 vi sybased

     205 ls

     206 chown sybase.sybase /dev/sybasevg

     207 chown -h sybase.sybase /dev/sybasevg/*

     208 ll

     209 more /etc/hots

     210 more /etc/hosts

     211 hostname

     212 cd /dev/sybasevg/

     213 ls

     214 ll

     215 cd /opt/sybase/ASE-15_0/install

     216 ls

     217 startserver -f RUN_DBSERVER

     218 . /opt/sybase/SYBASE.sh

     219 ls

     220 startserver -f RUN_DBSERVER

     221 passwd

     222 exit

     223 su - sybase

     224 su - sybase

     225 id sybase

     226 su - sybase

     227 ls

     228 passwd sybase

     229 ls

     230 lvscan

     231 lvextend -L +4G /dev/sybasevg/lvaudlog01 增加逻辑卷空间

     232 lvscan

     233 lvextend -L +256M /dev/sybasevg/lvseculog01

     234 lvscan

     235 ls

     236 cd /etc/init.d

     237 ls

     238 more sybased

     239 chown -R sybase.sybase /opt/sybase

     240 chown -R sybase.sybase /dev/sybasevg/

     241 chown -h sybase.sybase /dev/sybasevg/*

     242 su - sybase

     243 chwon -R sybase.sybase /dev/sybasevg/*

     244 chown sybase.sybase /dev/sybasevg/*

     245 cd /dev/mapper/

     246 ls

     247 ll

     248 vi /etc/init.d/sybased

     249 ls

     250 vmstat 1

     251 ls

     252 ll

     253 su - sybse

     254 su - sybase

     255 ll

     256 vi /etc/init.d/sybased

     257 ls

     258 reboot

     259 su - sybase

     260 cd /dev/sybasevg

     261 ls

     262 lv

     263 lv

     264 ll

     265 cd /dev/mapper/

     266 ll

     267 vi /etc/init.d/sybased

     268 ls

     269 ls

     270 ls

     271 ls

     272 more /etc/init.d/sybased

     273 service sybased start

     274 showserver

     275 showserver

     276 su - sybase

     277 su - sybase

     278 ifconfig

     279 su - sybase

     280 ls

     281 cd /etc/sysconfig/network

     282 ls

     283 cd /etc/sysconfig/network-scripts/

     284 ls

     285 vi ifcfg-eth0

     286 ifdown eth0

     287 ifup eth1

     288 ifconfi

     289 ifup eth0

     290 ifconfig

     291 service sybased stop

     292 showserver

     293 service sybased start

     294 ls

     295 crontab -l

     296 su - sybase

     297 df -u

     298 df -h

     299 fdisk -l

     300 cd /opt/sybase/

null

     345 ip route

     346 ping www.baidu.com

     347 crontab 0-l

     348 crontab -l

     349 ntpdate time.windows.com; hwclock -w

     350 freee

     351 free

     352 fdisk -l

     353 more /proc/cpuinfo

     354

     355 vmstat 1

     356 vmstat 1

     357 netstat -an | more

     358 chkconfig --list

     359 runlevel 查看当前系统运行等级

     360 more /etc/init.conf

     361 cd /etc

     362 ls

     363 more inittab 查看系统初始化配置

     364 more /etc/inittab

     365 more /etc/fstab

     366 more /etc/sysctl.conf

     367 netstat -an | more 查看网络TCP/IP连接信息

     368 top

     369 lvscan

     370 cd /

     371 ls

     372 cd /home/sybback/databack/

     373 ls

     374 ll

     375 rm new.dat

     376 su - sybase

     377 exit

     378 cd /home/sybback/databack

     379 ls

     380 cp dusto6.dat new.bat

     381 ll

     382 pwd

     383 ll

     384 rm new.bat

     385 last

     386 ls

     387 exit

     388 lsb_release -a 查看具体的发行版本

     389 exit

     390 ping 172.168

     391 ping 172.16.0.254

     392 service iptables

     393 service iptables retart

     394 service iptables restart

     395 ping 172.16.0.254

     396 ip route

     397 cd /etc/sysconfig

     398 lks

     399 ls

     400 more network

     401 cd network-scripts/

     402 ls

     403 more infcfg-eth1

     404 more infcfg-eth0

     405 more ifcfg-eth0

     406 more ifcfg-eth1

     407 cd ..

     408 ls

     409 vi network

     410 ping www.baidu.com

     411 more /etc/resolv.conf

     412 ls

     413 traceroute www.baidu.com 路由跟踪

     414 ping 172.16.0.5

     415 cd /home

     416 ls

     417 ls

     418 mkdir remoteback

     419 ls

     420 mount -t cifs -o username=sybase,password=1360112,rw,file_mode=0777,fir_mode=0777

    //172.16.0.5/sybase /home/remoteback 挂在远程共享目录到系统中

     421 df -h

     422 ls

     423 cd remoteback/

     424 ls

     425 mkdir databack

     426 ls

     427 ll

     428 chown -R databack

     429 ls

     430 chown -R sybase.sybase databack

Report this document

For any questions or suggestions please email
cust-service@docsford.com