- 전제: 로컬 서버로 설정
- SSH 서버 설치
- $ ssh apt install openssh-server openssh-client
- SSH 포트를 변경하고자 할 때
- 기본 포트는 22임을 확인
- $ sudo netstat -anp | grep LISTEN | grep sshd
- SSH 포트 설정 변경
- 1. sshd_config 파일을 편집
- 2. 아래와 같이 파일 내용을 수정
- SSH 포트 설정 확인 후 sshd 재시작
- $ cat /etc/ssh/sshd_config | egrep ^\#?Port
- $ sudo service sshd restart
- 변경된 SSH 포트로 접속하는 방법
- $ ssh user@domainAddress -p1234
- git 서버 저장소 설정하기
- $ sudo apt install git
- $ mkdir ~/gitRepository/myproject.git
- $ cd ~/gitRepository/myproject.git
- $ git init --bare --shared
- git 클라이언트 사이드 설정하기
- $ git clone user@domainAddress:1234/home/user/gitRepository/myproject.git
- $ git remote
- $ git config --global user.name ‘MY NAME’
- $ git config --global user.email ‘MY EMAIL’
- $ git config --list
- git 클라이언트 관련 참조
- http://www.tecmint.com/best-gui-git-clients-git-repository-viewers-for-linux/
- git command
- discard changes unstaged: $ git checkout -- .