CentOS
CentOS(8), RedHat, Amazon Linux2
hostnamectl
# hostnamectl Static hostname: Hostname01 # hostnamectl set-hostname NewHostName
timedatectl
# timedatectl Local Time : MDAY YYYY-MM-DD: HH:mm:ss UTC Universal Time: MDAY YYYY-MM-DD: HH:mm:ss UTC Time zone: n/a (UTC, +000) # timedatectl set-timezone Asia/Tokyo # timedatectl Local Time : MDAY YYYY-MM-DD: HH:mm:ss JST Universal Time: MDAY YYYY-MM-DD: HH:mm:ss UTC Time zone : Asia/Tokyo (JST, +0900)
Amazon Linux2 - Packages
# amazon-linux-extras list | grep package # amazon-linux-extras install package
Create Linux Group
# groupadd group01 -g 500 # groupadd group02 -g 501
Create Linux User
# useradd -u 500 user01 -g 500 # useradd -u 501 user02 -g 500 # useradd -u 502 user03 -g 501 # id user01 uid=500(user01) gid=500(group01) groups=500(group01) # id user02 uid=501(user02) gid=500(group01) groups=500(group01) # id user03 uid=502(user03) gid=501(group02) groups=501(group02)
User Mod
# usermod user01 -aG wheel # id user01 uid=500(user01) gid=500(group01) groups=500(group01),10(wheel)
umask
file:.bash_profile umask 0002 $ touch tmpfile $ ls -al -rw-rw-r-- 1 user01 group01 0 MDAY DAY hh:mm testfile