주 메뉴 열기

wwiki β

바뀜

리눅스

1,409 바이트 추가됨, 2023년 6월 18일 (일) 05:11
사용자 추가
== 배포판 ==
$ cat /etc/*-release
[[Debian]]
 
[[Alpine]]
 
== 보안 ==
==== 내부네트워크 허용 ====
$ sudo ufw allow from 192.168.0.0/24
=== [[SSH]] 보안 ===
==== 접속 로그 ====
<nowiki>#</nowiki> last
==== 접속 실패 로그 ====
<nowiki>#</nowiki>last -f /var/log/btmp
==== 비밀번호 접속 금지 설정 ====
[[SSH#.EC.84.A4.EC.A0.95.ED.8C.8C.EC.9D.BC|SSH 설정파일]]
== 계정 사용자 관리==사용자 정보는 [[/etc/passwd]]에 저장된다. 
=== 계정상태 확인===
$ id
 
=== 사용자 추가 ===
<syntaxhighlight lang="bash">
sudo useradd -m newuser
sudo passwd newuser
</syntaxhighlight>passwd명령으로 패스워드를 지정하지 않으면 해당 계정은 잠금상태이다.
 
-M 옵션을 사용하면 홈 디렉토리를 만들지 않는다.
 
=== 그룹 추가 ===
$ groupadd 그룹명
 
===유저를 그룹에 추가===
$ usermod --append --groups 그룹명 유저명
새로운 로그인 후부터 적용된다.
 
혹은
$ usermod -aG 그룹명 유저명
 
===유저를 그룹에서 제거===
$ gpasswd --delete 유저명 그룹명
 
===다른 사용자로 명령 실행===
$ sudo -u www-data cmd
==디렉토리==
다음 명령으로 매뉴얼을 확인할 수 있다. $ man hier */bin : 필수 명령어* /sbin 부팅관련 명령어: system programs and administration utilities*/usr : This directory is '''us'''ually mounted from a serparate partiontion('s resources). 리눅스가 실행중인 다양한 머신에서 마운트될 수 있다.*/usr/local : This is where programs which are local to the site typically go. 직접 컴파일해서 설치하는 등.
* /media/mnt 대체
* /lost+found 훼손된 파일장소
* /proc 시스템 정보를 저장하는 가상 파일 시스템
 
==파일==
* /etc/issue 콘솔로 접속했을 때 처음으로 출력될 내용
$ sudo -u 아이디 "명령어"
==find ==파일 검색, depth를 지정하지 않으면 모든 하위 디렉토리를 포함한다. $ find directory-location -group {group-name} -name {file-name}퍼미션 검색 $ find . -perm -g=x -type f파일검색 후 명령실행== $ find . -name "*.mp3" -exec ./test.sh {} \;
$ find . -type f -exec chmod o-w {} \;
* exclude path
find . -path ./misc -prune -o -name '*.txt' -print 
==signal==
유닉스 계열 OS에서 프로세스간 통신이다.
Ctrl+\
[[분류:리눅스]]
편집
2,431