linux常用命令

2017-06-20  本文已影响0人  crazydane

useradd -m
-m, --create-home
Create the user's home directory if it does not exist. The files and directories contained in the skeleton directory (which can be defined with the -k option) will be copied to the home directory.
useradd will create the home directory unless CREATE_HOME in /etc/login.defs is set to no.

查看硬件信息

查看系统信息
uname -i

普通用户密码忘记了,比较简单:

  1. 在root账户下,打开/etc/shadow (不是passwd文件,因为密码实际上经过加密后放在了“影子口令”文件shadow中了。passwd文件每个用户均可见,但是shadow只有root可以见)。
  2. 找到普通用户名cicikasa,然后删除第二个域即可,域之间用“:”隔开的,如下:
    cicikasa:TdkakkkYUukkjkjk:14672:0:99999:7:::
    上述红色部分就是经过加密的密码,删除即可
  3. 在普通用户下,输入passwd即可输入新密码

改用户权限

[shri@localhost ~]$ su - 
Password: 
[root@localhost ~]# vi /etc/sudoers 
then add
username        ALL=(ALL)      ALL
to sudoers
save and exit
ps aux|grep stream
getenforce 查看防火墙是否关闭,disabled为关闭
telnet localhost 18630
上一篇 下一篇

猜你喜欢

热点阅读