리눅스 계정 목록 보기

리눅스 계정 목록 보기
리눅스 계정 목록 확인
리눅스 계정 확인

1 전체 목록

명령어
cat /etc/passwd
cut -f1 -d: /etc/passwd
예시
[root@jmnote ~]# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
.. (생략)
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash
oprofile:x:16:16:Special user account to be used by OProfile:/home/oprofile:/sbin/nologin
named:x:25:25:Named:/var/named:/sbin/nologin
[root@jmnote ~]# cut -f1 -d: /etc/passwd
root
bin
daemon
adm
sync
shutdown
halt
mail
news
operator
games
gopher
ftp
nobody
dbus
nscd
avahi
mailnull
smmsp
apache
vcsa
rpc
ntp
sshd
pcap
haldaemon
rpm
hsqldb
xfs
gdm
mysql
oprofile
named

2 bash 사용자 목록

useradd로 계정을 만들면 기본적으로 /bin/bash 환경이 적용된다. bash 사용자 목록이 의미 있는 경우가 많다.

명령어
grep /bin/bash /etc/passwd
grep /bin/bash /etc/passwd | cut -f1 -d:
예시
[root@jmnote ~]# grep /bin/bash /etc/passwd
root:x:0:0:root:/root:/bin/bash
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash
[root@jmnote ~]# grep /bin/bash /etc/passwd | cut -f1 -d:
root
mysql

3 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}