반응형

리눅스/우분투에서 유저 추가하기

# sudo adduser [유저명]
# sudo adduser newUser

유저 추가하기

# sudo usermod -aG [그룹명] [유저명]
e.g.
# sudo usermod -aG sudo gildong
# sudo usermod -aG member gildong

유저 삭제하기

# sudo userdel [유저명]

유저의 정보는 /etc/passwd 파일을 출력해보면 확인 가능합니다.

어떤 그룹에 누구 속해있는지 확인하기
cat /etc/group



scp 명령어

두줄요약
- SecureCopy의 줄임말로, ssh 원격 접속 프로토콜을 기반으로 하는 복사임.
- 디폴트로 22번 포트 사용함. 그래서 다른포트로 접속했으면 scp에 포트번호 명시해줘야함.

// 로컬->서버로 복사 (파일)testfile1, testfile을 (디렉토리)/tmp/test에 복사
$ scp testfile1 testfile2 root@192.168.0.1:/tmp/test


// 로컬->서버로 복사 (디렉토리)testdir을 (디렉토리)/tmp/test에 복사
$ scp -r testdir root@192.168.0.1:/tmp/test

// 추가적인 옵션 p(원본  권한 속성 유지), P(포트지정)



// 서버->로컬로 복사 (파일)file1을 (디렉토리)/tmp에 복사
$ scp root@192.168.0.1:/tmp/test/file1 /tmp


// 서버->로컬로 복사 (디렉토리)testdir을 (디렉토리)/tmp에 복사
$ scp -r root@192.168.0.1:/tmp/testdir /tmp

// 서버->서버 간 복사 및 이동 (e.g. remote1 = 192.168.1.1, remote2 = 192.168.2.2)
// scp -3 [유저@소스] [유저@타겟]
$ scp -3 user1@remote1:/home/user1/file1.txt user2@remote2:/home/user2/file1.txt

서버->서버 간 복사/이동 https://unix.stackexchange.com/questions/184379/scp-from-one-server-to-another-server
https://superuser.com/questions/686394/scp-between-two-remote-hosts-from-my-third-pc

scp user1@remote1:/home/user1/file1.txt user2@remote2:/home/user2/file1.txt 이 명령어는 ~/.ssh/config파일에 양쪽 다 별도의 파일이 필요함.

vi
ga

xxd <파일> 명령어

- <파일>에 대해서 hex dump를 뜨는 명령어.
용법 1) xxd <파일>

$ cat test
asdasd

$ xxd test
00000000: 6173 6461 7364 0a                        asdasd.


용법 2) xxd -r <파일>
<파일>에 대해서 헥사값 -> 문자값으로 변환하여 출력함.

$ cat test
asdasd
$ xxd test > test_hex
$ xxd -r test_hex
asdasd


man 명령어

$ man -k <keyword> // <keyword>로 명령어 뜻 검색

반응형

'Linux > Linux 이야기' 카테고리의 다른 글

[Linux 이야기] 리눅스 전용 노트북 추천  (0) 2021.06.19