4-linux Foundation-2

Source: Internet
Author: User

Linux Basics-2

Switch multi-user virtual terminal CTRL+ALT+FN
PTS Right-click on the default user that opens
: 0 GUI GUI default login user
Ttyn: User with command-line mode login

$ normal User
# admin

Command: man.linuxde.net (Chinese command search)

Id
W.H.O.
WhoAmI
Date

date -s ‘2017-05-24 10:11:11‘  

Aa.
Clear = Ctrl+l
Su
passwd

echo ‘ads247‘ | passwd --stdin zhangwei

Mans

Linux command format

Cd
Alias
which
Type
SCSI disk A (SDA)
Mkdir
Touch
Virm
Rm-rf
Tree
CTRL + A E The end of the current command

Cat

打开文件

Head

head -n 100 access.log

Tail

tail -f access.logtail -n 100 access.log

More

按Space键:显示文本的下一屏内容。    按Enier键:只显示文本的下一行内容  按斜线符|:接着输入一个模式,可以在文本中寻找下一个相匹配的模式。按H键:显示帮助屏,该屏上有相关的帮助信息。  按B键:显示上一屏内容。   按Q键:退出rnore命令。  

Less

-e:文件内容显示完毕后,自动退出;  -f:强制显示文件;   -g:不加亮显示搜索到的所有关键词,仅显示当前显示的关键字,以提高显示速度;   -l:搜索时忽略大小写的差异;   -N:每一行行首显示行号;  -s:将连续多个空行压缩成一行显示;    -S:在单行显示较长的内容,而不换行显示;  -x<数字>:将TAB字符显示为指定个数的空格字符。  

/etc/passwd

用户名:密码占位符:用户id:组id:用户描述信息:Home路径:默认bash 密码占位符为x,删除则无需密码登陆  用户描述信息可有可无  

Action Group:

把用户添加到组: /etc/group

To add a user manually:

/etc/passwd/etc/shadows/etc/group/etc/gshadow/etc/skel  拷贝到home下wq! 强制保存退出.[!.]*  //notice

Delete User

userdel -r user1

Change user Properties

chown -R cx2c:cx2c /home/cx2c

Useradd

-c<备注>:加上备注文字。备注文字会保存在passwd的备注栏位中;  -d<登入目录>:指定用户登入时的启始目录;  -D:变更预设值; -e<有效期限>:指定帐号的有效期限;  -f<缓冲天数>:指定在密码过期后多少天即关闭该帐号;   -g<群组>:指定用户所属的群组;   -G<群组>:指定用户所属的附加群组;  -m:自动建立用户的登入目录;  -M:不要自动建立用户的登入目录;  -n:取消建立以用户名称为名的群组;  -r:建立系统帐号;   -s:指定用户登入后所使用的shell;   -u:指定用户id。  

Usermod

改组的属性-c<备注>:修改用户帐号的备注文字;  -d<登入目录>:修改用户登入时的目录;  -e<有效期限>:修改帐号的有效期限;  -f<缓冲天数>:修改在密码过期后多少天即关闭该帐号;  -g<群组>:修改用户所属的群组;  -G<群组>;修改用户所属的附加群组;   -l<帐号名称>:修改用户帐号名称;  -L:锁定用户密码,使密码无效;  -s:修改用户登入后所使用的shell;   -u:修改用户ID; -U:解除密码锁定。  

Safety

SELINUXsetenforce 0

Homework:

When SELinux is turned on
cx2c用户如果要想可以执行 /test/root.sh (root:root)在父文件夹是777的前提下此文件必须是------rwx 可执行           ------r-x 可执行           -------wx 不可执行           --------x 不可执行总结,在不受父路径权限影响下,文件必须rx才可以被所属用户执行    对于此文件的父文件夹,用户也必须有rx权限

4-linux Foundation-2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.