리눅스

 

 

 

 

 

# vi /etc/passwd

 

 1 root:x:0:0:root:/root:/bin/bash
      2 bin:x:1:1:bin:/bin:/sbin/nologin
      3 daemon:x:2:2:daemon:/sbin:/sbin/nologin
      4 adm:x:3:4:adm:/var/adm:/sbin/nologin
      5 lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
      6 sync:x:5:0:sync:/sbin:/bin/sync
      7 shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
      8 halt:x:7:0:halt:/sbin:/sbin/halt
      9 mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
     10 operator:x:11:0:operator:/root:/sbin/nologin
     11 games:x:12:100:games:/usr/games:/sbin/nologin
     12 ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
     13 nobody:x:99:99:Nobody:/:/sbin/nologin
     14 systemd-bus-proxy:x:999:997:systemd Bus Proxy:/:/sbin/nologin
     15 systemd-network:x:192:192:systemd Network Management:/:/sbin/nologin
     16 dbus:x:81:81:System message bus:/:/sbin/nologin
     17 polkitd:x:998:996:User for polkitd:/:/sbin/nologin
     18 abrt:x:173:173::/etc/abrt:/sbin/nologin
     19 unbound:x:997:994:Unbound DNS resolver:/etc/unbound:/sbin/nologin
     20 usbmuxd:x:113:113:usbmuxd user:/:/sbin/nologin
     21 tss:x:59:59:Account used by the trousers package to sandbox the tcsd daemon:/dev/null:/sbin/nologin
     22 apache:x:48:48:Apache:/usr/share/httpd:/sbin/nologin
     23 libstoragemgmt:x:996:993:daemon account for libstoragemgmt:/var/run/lsm:/sbin/nologin
     24 rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin
     25 colord:x:995:992:User for colord:/var/lib/colord:/sbin/nologin
     26 pcp:x:994:991:Performance Co-Pilot:/var/lib/pcp:/sbin/nologin
     27 saslauth:x:993:76:Saslauthd user:/run/saslauthd:/sbin/nologin
     28 geoclue:x:992:990:User for geoclue:/var/lib/geoclue:/sbin/nologin
  29 setroubleshoot:x:991:988::/var/lib/setroubleshoot:/sbin/nologin
     30 rtkit:x:172:172:RealtimeKit:/proc:/sbin/nologin
     31 qemu:x:107:107:qemu user:/:/sbin/nologin
     32 radvd:x:75:75:radvd user:/:/sbin/nologin
     33 chrony:x:990:987::/var/lib/chrony:/sbin/nologin
     34 ntp:x:38:38::/etc/ntp:/sbin/nologin
     35 sssd:x:989:986:User for sssd:/:/sbin/nologin
     36 rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
     37 nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
     38 pulse:x:171:171:PulseAudio System Daemon:/var/run/pulse:/sbin/nologin
     39 gdm:x:42:42::/var/lib/gdm:/sbin/nologin
     40 gnome-initial-setup:x:988:983::/run/gnome-initial-setup/:/sbin/nologin
     41 avahi:x:70:70:Avahi mDNS/DNS-SD Stack:/var/run/avahi-daemon:/sbin/nologin
     42 postfix:x:89:89::/var/spool/postfix:/sbin/nologin
     43 sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
     44 tcpdump:x:72:72::/:/sbin/nologin
     45 oprofile:x:16:16:Special user account to be used by OProfile:/var/lib/oprofile:/sbin/nologin
     46 centos:x:1000:1000:centos:/home/centos:/bin/bash
    centos:비번:번호:그룹번호 :전체이음 :/home/centos/:기본 셀


=>
 비밀번호는  /etc/shdow 에서 관리한다.

[root@localhost etc]# vi /etc/passwd
[root@localhost etc]# vi /etc/group

root:x:0:
bin:x:1:
daemon:x:2:
sys:x:3:
adm:x:4:
tty:x:5:
disk:x:6:
lp:x:7:
mem:x:8:
kmem:x:9:
wheel:x:10:centos
cdrom:x:11:
mail:x:12:postfix
man:x:15:
dialout:x:18:
floppy:x:19:
games:x:20:
tape:x:30:
video:x:39:
ftp:x:50:
lock:x:54:
audio:x:63:
nobody:x:99:
"/etc/group" 73L, 1005C
qemu:x:107:
radvd:x:75:
chrony:x:987:
ntp:x:38:
sssd:x:986:
rpcuser:x:29:
nfsnobody:x:65534:
pulse-access:x:985:
pulse-rt:x:984:
pulse:x:171:
gdm:x:42:
gnome-initial-setup:x:983:
avahi:x:70:
slocate:x:21:
postdrop:x:90:
postfix:x:89:
sshd:x:74:
stapusr:x:156:
stapsys:x:157:
stapdev:x:158:
tcpdump:x:72:
oprofile:x:16:
centos:x:1000:centos
그룹이름:비번:그룹아이디:사용자

[root@localhost etc]# useradd myuser
[root@localhost etc]# tail -5 /etc/passwd

sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
tcpdump:x:72:72::/:/sbin/nologin
oprofile:x:16:16:Special user account to be used by OProfile:/var/lib/oprofile:/sbin/nologin
centos:x:1000:1000:centos:/home/centos:/bin/bash
myuser:x:1001:1001::/home/myuser:/bin/bash

==>이방식은 별로 좋은 방식이 아니다.

사용자 그룹을 먼저 만들고 사용자를 추가 한다.


http://download.hanbit.co.kr/centos/7/CentOS-Server2.exe

# useradd user1
# tail -5 /etc/passwd


#tail -5 /etc/shadow


=> 그룹을 먼저 만든다.


#userdel user1

=>user1 이 작업하던 파일들은 남아 있다. 왜냐하면 user1 직원이 하던 일이 알기위해.

#userdel -r user1 
=> user1 폴더까지 모두 삭제한다.


1.그룹을 먼저 만든다.


# groupadd centosGroup
# tail -5 /etc/group

2.사용자를 만든다.

# useradd  -g centosGroup  user1
# useradd  -g centosGroup  user2
# tail -5 /etc/passwd

비밀 번호 보기
# tail -5 /etc/shadow

3. 비밀번호 만들기

#  passwd user1

=>일반 사용자는 비빌번호를 4글자로 못 만들지만 root 사용자는 가능하다

# ls -l /home


 * x 윈도우에서도 관리 할 수 있다.

# system-config-users

=>설치가 안되어 있다.

# yum  -y install system-config-users


 

 

 

 

 

 

 

 

linux

 

about author

PHRASE

Level 60  머나먼나라

남에게 부정하게 대하지 말 것이며, 남이 나에게 부정하게 못하게 하라. -마호메트

댓글 ( 4)

댓글 남기기

작성
  •    
  •    
  •