1. update

ellord@ellord-Precision-T5600:~$ sudo apt-get update
[sudo] ellord 암호:
기존:1 http://kr.archive.ubuntu.com/ubuntu focal InRelease
받기:2 http://kr.archive.ubuntu.com/ubuntu focal-updates InRelease [128 kB]
받기:3 http://kr.archive.ubuntu.com/ubuntu focal-backports InRelease [128 kB]
받기:4 http://kr.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [276 kB]
받기:5 http://security.ubuntu.com/ubuntu focal-security InRelease [128 kB]
받기:6 http://kr.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 DEP-11 Metadata [212 B]
받기:7 http://kr.archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [446 kB]
받기:8 http://kr.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [940 B]
받기:9 http://kr.archive.ubuntu.com/ubuntu focal-backports/main amd64 DEP-11 Metadata [7,984 B]
받기:10 http://kr.archive.ubuntu.com/ubuntu focal-backports/restricted amd64 DEP-11 Metadata [216 B]
받기:11 http://kr.archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [30.5 kB]
받기:12 http://kr.archive.ubuntu.com/ubuntu focal-backports/multiverse amd64 DEP-11 Metadata [212 B]
받기:13 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [74.7 kB]
받기:14 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 DEP-11 Metadata [212 B]
받기:15 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [160 kB]
받기:16 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 DEP-11 Metadata [940 B]
내려받기 1,381 k바이트, 소요시간 2초 (621 k바이트/초)
패키지 목록을 읽는 중입니다... 완료

 

 

2. git 설치

ellord@ellord-Precision-T5600:~$ sudo apt-get install git
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
패키지 git는 이미 최신 버전입니다 (1:2.25.1-1ubuntu3.14).
0개 업그레이드, 0개 새로 설치, 0개 제거 및 65개 업그레이드 안 함.

 

3. 버전확인

ellord@ellord-Precision-T5600:~$ git --version
git version 2.25.1

 

4. git 사용자 추가

ellord@ellord-Precision-T5600:~$ sudo adduser git
'git' 사용자를 추가 중...
새 그룹 'git' (1002) 추가 ...
새 사용자 'git' (1002) 을(를) 그룹 'git' (으)로 추가 ...
'/home/git' 홈 디렉터리를 생성하는 중...
'/etc/skel'에서 파일들을 복사하는 중...
새  암호:
새  암호 재입력:
passwd: 암호를 성공적으로 업데이트했습니다
git의 사용자의 정보를 바꿉니다
새로운 값을 넣거나, 기본값을 원하시면 엔터를 치세요
    이름 []:
    방 번호 []:
    직장 전화번호 []:
    집 전화번호 []:
    기타 []:
정보가 올바릅니까? [Y/n] Y

 

5. git 사용자 폴더 확인

ellord@ellord-Precision-T5600:~$ sudo su git
git@ellord-Precision-T5600:/home/ellord$ cd /home
git@ellord-Precision-T5600:/home$ ls
ellord  git
git@ellord-Precision-T5600:/home$ cd git
git@ellord-Precision-T5600:~$ ll
합계 20
drwxr-xr-x 2 git  git  4096  1월 25 08:59 ./
drwxr-xr-x 5 root root 4096  1월 25 08:59 ../
-rw-r--r-- 1 git  git   220  1월 25 08:59 .bash_logout
-rw-r--r-- 1 git  git  3771  1월 25 08:59 .bashrc
-rw-r--r-- 1 git  git   807  1월 25 08:59 .profile
git@ellord-Precision-T5600:~$ cd ~git
git@ellord-Precision-T5600:~$ pwd
/home/git

 

6. ssh 설정

git@ellord-Precision-T5600:~$ mkdir .ssh
git@ellord-Precision-T5600:~$ ls -la
합계 24
drwxr-xr-x 3 git  git  4096  1월 25 09:01 .
drwxr-xr-x 5 root root 4096  1월 25 08:59 ..
-rw-r--r-- 1 git  git   220  1월 25 08:59 .bash_logout
-rw-r--r-- 1 git  git  3771  1월 25 08:59 .bashrc
-rw-r--r-- 1 git  git   807  1월 25 08:59 .profile
drwxrwxr-x 2 git  git  4096  1월 25 09:01 .ssh
git@ellord-Precision-T5600:~$ chmod 700 .ssh
git@ellord-Precision-T5600:~$ ll
합계 24
drwxr-xr-x 3 git  git  4096  1월 25 09:01 ./
drwxr-xr-x 5 root root 4096  1월 25 08:59 ../
-rw-r--r-- 1 git  git   220  1월 25 08:59 .bash_logout
-rw-r--r-- 1 git  git  3771  1월 25 08:59 .bashrc
-rw-r--r-- 1 git  git   807  1월 25 08:59 .profile
drwx------ 2 git  git  4096  1월 25 09:01 .ssh/

 

 

7. 인증키 저장소 설정

git@ellord-Precision-T5600:~$ touch ~/.ssh/authorized_keys
git@ellord-Precision-T5600:~$ cd .ssh
git@ellord-Precision-T5600:~/.ssh$ ls
authorized_keys
git@ellord-Precision-T5600:~/.ssh$ ll
합계 8
drwx------ 2 git git 4096  1월 25 09:02 ./
drwxr-xr-x 3 git git 4096  1월 25 09:01 ../
-rw-rw-r-- 1 git git    0  1월 25 09:02 authorized_keys
git@ellord-Precision-T5600:~/.ssh$ chmod 600 authorized_keys
git@ellord-Precision-T5600:~/.ssh$ cat authorized_keys
git@ellord-Precision-T5600:~/.ssh$ cat authorized_keys

 

아직 등록된 키가 없음.

 

8. git 저장소 설정

git@ellord-Precision-T5600:~$ mkdir test-repo.git
git@ellord-Precision-T5600:~$ cd test-repo.git/
git@ellord-Precision-T5600:~/test-repo.git$ ls -la
합계 8
drwxrwxr-x 2 git git 4096  1월 25 09:02 .
drwxr-xr-x 4 git git 4096  1월 25 09:02 ..
git@ellord-Precision-T5600:~/test-repo.git$ git init --bare
/home/git/test-repo.git/ 안의 빈 깃 저장소를 다시 초기화했습니다
git@ellord-Precision-T5600:~/test-repo.git$ ls -la
합계 40
drwxrwxr-x 7 git git 4096  1월 25 09:03 .
drwxr-xr-x 4 git git 4096  1월 25 09:02 ..
-rw-rw-r-- 1 git git   23  1월 25 09:03 HEAD
drwxrwxr-x 2 git git 4096  1월 25 09:03 branches
-rw-rw-r-- 1 git git   66  1월 25 09:03 config
-rw-rw-r-- 1 git git   73  1월 25 09:03 description
drwxrwxr-x 2 git git 4096  1월 25 09:03 hooks
drwxrwxr-x 2 git git 4096  1월 25 09:03 info
drwxrwxr-x 4 git git 4096  1월 25 09:03 objects
drwxrwxr-x 4 git git 4096  1월 25 09:03 refs

 

 

9. 프로젝트 클라이언트에서 ssh 키를 생성해서 서버로 전송 후 ssh 키 확인

git@ellord-Precision-T5600:~/.ssh$ cat authorized_keys 
ssh-rsa AAAAB3NzaC1yc2EAAAADAuBvZATIoyUKcvlZjCWwFIh1QF2hWU20161Olth+bpsB71pFOXqcS/YikmeaqLOGS9EOie/8tsOADqtfUeV9NtLYkD8RUKSuUK3Y4SEvE9mf3LrJd+x9H1ZZtLmxUYjRkSlX0yDzxCkE1Dz6xRBmVI1ZBM1DHoD2E2jQqh90N6QI5oZsV40uwRfYGmnGozuwPBiSKSfNDPJqaTriMH2mvgtNGo17GMHdtkJn0mslF5cLlEpES5HlIq6WecHG1xyJ67IgG/vkXbKIFvLl4/DCumpU+xp8GBMJsAYyI5Y70Ils3G01oSBBUE0TznOs4mSRYO2j6yl26yopIrG+yl+tw2qB5kvN3AlD48KmkhnRM58adxdmGQdNKieKYS/tvJWCjLQACtIaO1K5bDQ1Hfmu9m8m2/VrvGxltDleXG+a0WFX1HbZAxXHtls6eTz1cf4f6B2oBerm53WBhQE3p/3BmDThg927XQMudvjNT2k1Dz5Us= ellord@ellord-Precision-T5600
ssh-rsa AAAAB3NzaC1yc2EAAAADAqZz1M0GgPXNSvdx/X4tBKhnZUcjw/Y9ft3hMHdMHIraMCFoO/guafOW4
kotLkFim3nOdwwzT1cb9ircwR3ikI8SN8NXuLjXIOODVbbL9KBpzcC3fhct+HPtXXMoNP8dyY9XGUwQF1P9Y
/UeimL5FP7QGjXjc/6BQlfUrNETLwCduxLio1qQ3DcxuxjpvgXhzEf9anyFjYG9Uo67KLk7pDgRn6pQAmmXe
9U7+8VcHp+GGcoLjZJU77ra77HRXhzLOANvFsX//fkMJ6AQwSKC22tXEa+TARsEjSkvCAq0zbJCHPZWeQ0pN
6OpTrTfDtl1gTeYOq9Zq+r8EeFyM+8PhBwMIQLdaO0BVrQa0+Jbg6jyDL5i281eSh8/lYZ5C8stf9SsmypsT
wr7H4DYOzeuXQEENLh/Sid7EUvWymMlwXvV4OmEPjxB0DLD7/l2IDlvFD7vf5uXCMQ1yQ5sq/lI3QNyFnkM
K3fwg9aLqconK1J1txcwAeM= ellord@Chanui-MacBookPro.local
git@ellord-Precision-T5600:~/.ssh$ cd ..
블로그 이미지

엘로드넷

,

1. 메뉴에서 VCS ->  버전 관리 통합 활성화 선택

 

 

2. Git 선택

 

 

 

3. VCS -> Git 으로 변경된 메뉴를 클릭하고 원격 관리... 를 선택한다.

 

 

4. + 를 클릭하여 사설 저장소를 등록한다.

 

 

 

5. 저장소 연결 

 

 

6. 비밀번호 입력

 

 

7. 추가중

 

 

8. 추가완료

 

 

 

9. 프로젝트 폴더에 터미널로 이동

 

ellord@Chanui-MacBookPro Redis % git init
ellord@Chanui-MacBookPro Redis % ls -la
total 8
drwxr-xr-x   6 ellord  staff  192 Jan 25 10:09 .
drwxr-xr-x   6 ellord  staff  192 Jan 25 09:37 ..
drwxr-xr-x  13 ellord  staff  416 Jan 25 10:22 .git
drwxr-xr-x   8 ellord  staff  256 Jan 25 09:59 .idea
-rw-r--r--   1 ellord  staff    4 Jan 25 10:08 test.html
-rw-r--r--   1 ellord  staff    0 Jan 25 10:09 test2.html

 

git init 후 

.git 폴더가 생성됨

 

git add *
git config user.email "test@test.com"
git config user.name "git"
git commit -m "커밋테스트"

 

서버로 push 하기전까지 commit

 

 

10.  git 서버 접속설정 : rsa_key 생성

 

ellord@Chanui-MacBookPro Redis % ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/ellord/.ssh/id_rsa):
...
중략(비밀번호 입력)
...

 

사용자 홈 디렉토리에 .ssh 폴더가 생기고 id_rsa, id_rsa.pub 파일이 생김

ellord@Chanui-MacBookPro .ssh % ls -la
total 32
drwx------   6 ellord  staff   192 Jan 25 10:41 .
drwxr-x---+ 54 ellord  staff  1728 Jan 25 10:41 ..
-rw-------   1 ellord  staff  2675 Jan 25 10:17 id_rsa
-rw-r--r--   1 ellord  staff   584 Jan 25 10:17 id_rsa.pub
-rw-------   1 ellord  staff  1234 Jan 25 09:19 known_hosts
-rw-------   1 ellord  staff  1057 Jan 25 09:19 known_hosts.old

 

 

id_rsa.pub 파일을 git 서버로 전송함.

ellord@Chanui-MacBookPro .ssh % ssh-copy-id -i id_rsa.pub git@git서버주소
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
Enter passphrase for key './id_rsa':

 

rsa 파일생성시 만든 비밀번호를 입력해 줌.

 

Enter passphrase for key './id_rsa': 

/usr/bin/ssh-copy-id: WARNING: All keys were skipped because they already exist on the remote system.
                (if you think this is a mistake, you may want to use -f option)

 

두번째 시도하는거라서 이미 등록되어 있다고 나옴.

 

 

git 서버에서 확인해 봄.

git@ellord-Precision-T5600:~/.ssh$ pwd
/home/git/.ssh
git@ellord-Precision-T5600:~/.ssh$ ls
authorized_keys
git@ellord-Precision-T5600:~/.ssh$ cat authorized_keys 
ssh-rsa +bpsB71pFOXqcS/YikSuUK3Y4SEvE9mf3LrJd+x9H1ZZtLmxUYjRkSlX0yDzxCkE1Dz6xRBmVI1ZBM1DHoD2E2jQqh90N6QI5oZsV40uwRfYGmnGozuwPBiSKSfNDPJqaTriMH2mvgtNGo17GMHdtkJn0mslF5cLlEpES5HlIq6WecHG1xyJ67IgG/vkXbKIFvLl4/DCumpU+xp8GBMJsAYyI5Y70Ils3G01oSBBUE0TznOs4mSRYO2j6yl26yopIrG+yl+tw2qB5kvN3AlD48KmkhnRM58adxdmGQdNKieKYS/tvJWCjLQACtIaO1K5bDQ1Hfmu9m8m2/VrvGxltDleXG+a0WFX1HbZAxXHtls6eTz1cf4f6B2oBerm53WBhQE3p/3BmDThg927XQMudvjNT2k1Dz5Us= ellord@ellord-Precision-T5600
ssh-rsa AAAAAADAQABAAABgQD4F78UQKmYy2TjbqZz1M0GgPXNSvdx/X4tBKhnZUcjw/Y9ft3hMHdMHIraM
CFoO/guafOW4kotLkFim3nOdwwzT1cb9ircwR3ikI8SN8NXuLjXIOODVbbL9KBpzcC3fhct+HPtXXMoNP8d
yY9XGUwQF1P9Y/UeimL5FP7QGjXjc/6BQlfUrNETLwCduxLio1qQ3DcxuxjpvgXhzEf9anyFjYG9Uo67KLk
7pDgRn6pQAmmXe9U7+8VcHp+GGcoLjZJU77ra77HRXhzLOANvFsX//fkMJ6AQwSKC22tXEa+TARsEjSkv
CAq0zbJCHPZWeQ0pN6OpTrTfDtl1gTeYOq9Zq+r8EeFyM+8PhBwMIQLdaO0BVrQa0+Jbg6jyDL5i281eS
h8/lYZ5C8stf9SsmypsTwr7H4DYOzeuXQEENLh/Sid7EUvWymMlwXvV4OmEPjxB0DLD7/l2IDlvFD7vf5u
XCMQ1yQ5sq/lI3QNyFnkMK3fwg9aLqconK1J1txcwAeM= ellord@Chanui-MacBookPro.local
git@ellord-Precision-T5600:~/.ssh$

 

 

정상적으로 등록됨

ssh-rsa 문자열의 마지막 부분 ellord@Chanui-MacBookPro.local 이 rsa를 생성했던 호스트명으로 확인됨.

 

 

 

 

 

11. git 서버로 푸시해봄.

 

ellord@Chanui-MacBookPro Redis % git status
On branch main
Your branch is up to date with 'origin/main'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        .idea/

nothing added to commit but untracked files present (use "git add" to track)

 

 

git push

ellord@Chanui-MacBookPro Redis % git push --set-upstream origin main
Enter passphrase for key '/Users/ellord/.ssh/id_rsa': 
branch 'main' set up to track 'origin/main'.
Everything up-to-date

 

새로운 파일을 추가하고 시도해 봄

ellord@Chanui-MacBookPro Redis % touch test3.html
ellord@Chanui-MacBookPro Redis % ls
test.html       test2.html      test3.html
ellord@Chanui-MacBookPro Redis % git add *
ellord@Chanui-MacBookPro Redis % git status
On branch main
Your branch is up to date with 'origin/main'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        new file:   test3.html

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        .idea/

ellord@Chanui-MacBookPro Redis % git commit -m "TEST3"
[main 03ba7e0] TEST3
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 test3.html

ellord@Chanui-MacBookPro Redis % git status
On branch main
Your branch is ahead of 'origin/main' by 1 commit.
  (use "git push" to publish your local commits)

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        .idea/

nothing added to commit but untracked files present (use "git add" to track)

ellord@Chanui-MacBookPro Redis % git push
Enter passphrase for key '/Users/ellord/.ssh/id_rsa': 
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Delta compression using up to 8 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 257 bytes | 257.00 KiB/s, done.
Total 2 (delta 0), reused 0 (delta 0), pack-reused 0
To 218.152.213.110:/home/git/test-repo.git
   14c3dfe..03ba7e0  main -> main
ellord@Chanui-MacBookPro Redis %

 

 

 

 

 

 

 

블로그 이미지

엘로드넷

,

1. 설정파일 수정

ellord@ellords-Mac-mini etc % vi /usr/local/etc/mongod.conf

 

 

2. bindIp: 127.0.0.1 을 변경

 

0.0.0.0 모든 곳에서 접속

127.0.0.1, 192.168.0.10 : 로컬과 192.168.0.10 에서 접속

 

systemLog:
  destination: file
  path: /usr/local/var/log/mongodb/mongo.log
  logAppend: true
storage:
  dbPath: /usr/local/var/mongodb
net:
  bindIp: 0.0.0.0, ::1
  ipv6: true
~                                                                                        
~                                                                                        
~

 

 

3. mongodb 재시작(중지 & 시작)

ellord@ellords-Mac-mini 57dbBackup % brew services stop mongodb-community@4.4
Stopping `mongodb-community@4.4`... (might take a while)
==> Successfully stopped `mongodb-community@4.4` (label: homebrew.mxcl.mongodb-community@4.4)
ellord@ellords-Mac-mini 57dbBackup % brew services start mongodb-community@4.4
==> Successfully started `mongodb-community@4.4` (label: homebrew.mxcl.mongodb-community@4.4)

 

'MongoDB' 카테고리의 다른 글

macos 에서 mongodb 재시작  (0) 2025.10.31
블로그 이미지

엘로드넷

,