{"componentChunkName":"component---src-templates-blog-post-js","path":"/CS/hosts_ssh_port_ip/","result":{"data":{"site":{"siteMetadata":{"title":"Progress Not Perfection","author":"Sunmin","siteUrl":"https://sunmin.netlify.com","comment":{"disqusShortName":"","utterances":"Sunmin0520/blog"}}},"markdownRemark":{"id":"5d13eec9-19ab-5a5e-a971-0ad9964ee244","excerpt":"글을 쓰는 목적 오랜만에 들어가는 서버에 접속이 안 되어서 찾아보니 접속정보가 바뀌어 있었다. .ssh/config에 들어가 ProxyJump 정보를 수정하니 접근이 가능해졌고, 이 참에 관련 내용들을 한번에 정리하고 싶었다. etc/hosts  호스트(로컬 호스트 및 기타 호스트들)대한 IP 주소와 호스트 이름 정보 담는 DNS 기능의 파일 참고 리눅스 파일 구조   /etc 환경 설정 관련 파일들(configuration files) 각각의 프로그램 실행 및 중지 위한 shell scripts…","html":"<h3 id=\"글을-쓰는-목적\" style=\"position:relative;\"><a href=\"#%EA%B8%80%EC%9D%84-%EC%93%B0%EB%8A%94-%EB%AA%A9%EC%A0%81\" aria-label=\"글을 쓰는 목적 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>글을 쓰는 목적</h3>\n<ul>\n<li>오랜만에 들어가는 서버에 접속이 안 되어서 찾아보니 접속정보가 바뀌어 있었다.<br>\n.ssh/config에 들어가 ProxyJump 정보를 수정하니 접근이 가능해졌고, 이 참에 관련 내용들을 한번에 정리하고 싶었다.</li>\n</ul>\n<h1 id=\"etchosts\" style=\"position:relative;\"><a href=\"#etchosts\" aria-label=\"etchosts permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>etc/hosts</h1>\n<ul>\n<li><code class=\"language-text\">code /etc/hosts</code></li>\n<li>\n<p>호스트(로컬 호스트 및 기타 호스트들)대한 IP 주소와 호스트 이름 정보 담는 DNS 기능의 파일</p>\n<img src=\"https://user-images.githubusercontent.com/79896443/153759284-64771ceb-eca7-485a-97e5-2256ac8220aa.jpg\" width=\"400\">  \n</li>\n<li>\n<p>참고</p>\n<ul>\n<li>리눅스 파일 구조  </li>\n</ul>\n<img src=\"https://user-images.githubusercontent.com/79896443/153759290-6c8ae833-3415-4fd3-85e6-760ed4d4f8c1.png\" width=\"400\">\n<ul>\n<li>\n<p>/etc</p>\n<ul>\n<li>환경 설정 관련 파일들(configuration files)</li>\n<li>각각의 프로그램 실행 및 중지 위한 shell scripts </li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n<h1 id=\"host\" style=\"position:relative;\"><a href=\"#host\" aria-label=\"host permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>host</h1>\n<ul>\n<li>host: IP 주소 가지고 있는 시스템. IP주소 통해 호스트끼리 식별, 확인할 수 있다.</li>\n<li>\n<p>localhost: 내 컴퓨터의 주소를 부르는 용어</p>\n<ul>\n<li>IPv4일 때는 127.0.0.1, IPv6일 때는 ::1의 IP주소로 localhost DNS</li>\n</ul>\n</li>\n</ul>\n<h1 id=\"ssh\" style=\"position:relative;\"><a href=\"#ssh\" aria-label=\"ssh permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>ssh</h1>\n<ul>\n<li>원격으로 다른 시스템에 로그인할 때 사용 (더 정확히는 원격 서버를 더 안전하게 제어 위한 프로토콜 혹은 그 프로토콜에서 사용하는 프로그램들)</li>\n<li>\n<p>각 ssh 접속 정보들은 Host, Hostname, User, IdentityFile, ProxyJump 등을 가진다.</p>\n<ul>\n<li><code class=\"language-text\">code ~/.ssh</code> 입력해서 .ssh/config 열어서 정보 CRUD한다.</li>\n</ul>\n<img src=\"https://user-images.githubusercontent.com/79896443/153759286-e6388b16-9093-49e8-b7e2-37bf560e290c.jpg\" width=\"400\">\n</li>\n<li>\n<p>원격 서버 들어가는 방법</p>\n<ul>\n<li>host이름이 server1이라면 <code class=\"language-text\">ssh server1</code>입력  </li>\n</ul>\n</li>\n<li>ProxyJump: 로컬에서 특정 서버에 바로 들어갈 수 없을 때 거쳐가야 하는 Host를 ProxyJump에 적는다.</li>\n</ul>\n<h1 id=\"root-directory-vs-home-directory\" style=\"position:relative;\"><a href=\"#root-directory-vs-home-directory\" aria-label=\"root directory vs home directory permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Root Directory VS Home Directory</h1>\n<ul>\n<li>Root Directory: 시스템 드라이브의 최상위 레벨. ’/’</li>\n<li>\n<p>Home Directory: Root directory의 subdirectory. ’~’</p>\n<ul>\n<li>’~‘는 실제로는 /Users/sunmin의 path </li>\n</ul>\n</li>\n</ul>\n<h1 id=\"port\" style=\"position:relative;\"><a href=\"#port\" aria-label=\"port permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>port</h1>\n<ul>\n<li>\n<p>포트: 하나의 서버에는 여러 개의 서버 설치될 수 있고, 각 서버마다 포트 번호 따로 지정해서 구분하는 주소 개념</p>\n<ul>\n<li>\n<p>well-known port: 0~1023  </p>\n<ul>\n<li>웹서버는 기본적으로 80에 연결 등  </li>\n</ul>\n</li>\n<li>registered port: 1024~49151에서 등록된 포트 구간</li>\n<li>well-known port, registered port 이외에는 자유롭게 쓰면 된다.  </li>\n</ul>\n<img src=\"https://user-images.githubusercontent.com/79896443/153759293-e6c972ed-d8b0-4407-b997-8f033ed30816.png\" width=\"700\">\n</li>\n</ul>\n<h1 id=\"ip-주소\" style=\"position:relative;\"><a href=\"#ip-%EC%A3%BC%EC%86%8C\" aria-label=\"ip 주소 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>ip 주소</h1>\n<ul>\n<li>ip주소 결정 규칙: 네트웍 주소 + 호스트 주소인데 그 비율에 따라 클래스 나뉨</li>\n<li>\n<p>IPv4의 경우 8비트(0~255) 4개의 조합</p>\n<img src=\"https://user-images.githubusercontent.com/79896443/153759295-7476fefc-f976-450a-88df-f9ff816000c5.png\" width=\"650\">\n</li>\n</ul>\n<p><strong>출처</strong></p>\n<p><a href=\"https://www.thegeekstuff.com/2010/09/linux-file-system-structure/\">https://www.thegeekstuff.com/2010/09/linux-file-system-structure/</a><br>\n<a href=\"https://opentutorials.org/course/3265/20037\">https://opentutorials.org/course/3265/20037</a><br>\n<a href=\"https://ko.wikipedia.org/wiki/TCP/UDP%EC%9D%98_%ED%8F%AC%ED%8A%B8_%EB%AA%A9%EB%A1%9D\">https://ko.wikipedia.org/wiki/TCP/UDP%EC%9D%98_%ED%8F%AC%ED%8A%B8_%EB%AA%A9%EB%A1%9D</a><br>\n<a href=\"https://xn--3e0bx5euxnjje69i70af08bea817g.xn--3e0b707e/jsp/resources/ipv4Info.jsp\">https://xn—3e0bx5euxnjje69i70af08bea817g.xn—3e0b707e/jsp/resources/ipv4Info.jsp</a></p>","frontmatter":{"title":"[CS] ssh, host, port, ip","date":"February 13, 2022"}}},"pageContext":{"slug":"/CS/hosts_ssh_port_ip/","previous":{"fields":{"slug":"/books/the_programmers_brain/"},"frontmatter":{"title":"[서적] 프로그래머의 뇌","category":"books","draft":false}},"next":{"fields":{"slug":"/Retrospective/2022/Feb/13th/"},"frontmatter":{"title":"[일기] 2월 13일","category":"retrospective","draft":false}}}},"staticQueryHashes":["3128451518","521680639"]}