becool

20210427 (화) 본문

linux

20210427 (화)

gusalstm 2021. 4. 27. 16:49
반응형

9:33 review

 

NIC(network interface card) : 컴퓨터가 네트워크에 물리적으로 연결하기 위해 사용하는 네트워크 카드

IP주소 : 네트워크 상에서 호스트 끼리 식별하기 위한 논리적 주소

서브넷 마스크 : IP 주소에서 Network ID와 Host ID를 구별하기 위한 마스크 값

게이트웨이 : 다른 네트워크와 통신하기 위해 거치는 관문

 

NetworkManager

 Systemd 시스템에서 기본 네트워크 관리 서비스

 Connection을 사용하여 네트워크 구성을 관리함

 하나의 네트워크 카드는 여러개의 Connection을 가질 수 있음

 하나의 네트워크 카드는 동시에 하나의 Activated Connection을 가짐.

 

# nmcli

# nmtui : gui형태이나 버그가 있어서 잘 쓰여지지 않음.

# nm-connection-editor

nmcli con add con-name NAME type NIC_TYPE ifname NIC_NAME
nmcli con mod NAME ipv4.addresses 00.000.000.000/24
nmcli con mod NAME ipv4.gateway 000.000.000.000
nmcli con mod NAME ipv4.dns 168.53.63.1
nmcli con mod NAME ipv4.method AUTO/MANUAL
nmcli con up NAME
nmcli con show NAME
ifconfig

/etc/sysconfig/network-scripts/

/etc/sysconfig/network-scripts/ifcfg-NAME 을 통한 변경사항 저장

TYPE = Ethernet  → 네트워크 카드 종류

BOOTPROTO = dhcp → IP주소 할당 방식 (자동 : dhcp, 수동 : none)

NAME= NAME → 커넥션 이름

DEVICE = enp0s3 → 네트워크 카드 이름

ONBOOT = yes → 네트워크 자동 연결 활성화 여부 (활성 : yes, 비활성 : no)

IPADDR=x.x.x.x → IP주소(IPv4)

PREFIX=xx  → PREFIX

GATEWAY=x.x.x.x → 게이트웨이 주소

DNS1=x.x.x.x → DNS 서버 주소(1부터 시작) & DNS 서버 우선순위 지정

 

==================================

HOSTNAME (/etc/hostname)

# vi /etc/hostname  편집 후

# systemctl restart NetworkManager.service 적용

# hostname 확인

 

 ▶ 번거로우므로 아래 내용으로

 # hostnamectl status

 # hostnamectl set-hostname NAME → 세팅

 # hostnamectl set-hostname ""   → 제거

 

 

 

===========================

Ch12. SSH (OpenSSH)

SSH(Secure SHell)
 - 원격접속 프로토콜로 전송 구간을 암호화함.

/etc/ssh  - SSH Client 및 Server 구성 파일 경로
~/.ssh     - 사용자 별 SSH 구성파일, KEY
  known_hosts  : 접속 Host 및 접속 Host의 Host Key(공개키)

 

ssh-keygen

ssh-copy-id USER@HOST

 

키를 생성하고 키값을 전달하여 암호 없이 접속

 

 

[root@host1 ~]# ssh-keygen 
[root@host1 ~]# ssh-copy-id root@192.168.56.12
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host '192.168.56.12 (192.168.56.12)' can't be established.
ECDSA key fingerprint is SHA256:sZeNa2oODebd+X/y8ZD5qNokGbt3laesg0sI0QO3i+Y.
ECDSA key fingerprint is MD5:5b:bf:06:0c:24:13:08:14:d5:88:7d:89:47:f3:ff:e6.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
user@192.168.56.12's password:  

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'root@192.168.56.12'"
and check to make sure that only the key(s) you wanted were added.
[root@host1 .ssh]$ ssh root@192.168.56.12
Last login: Tue Apr 27 16:20:38 2021 from 192.168.56.11
[root@host2 ~]# exit
logout
Connection to 192.168.56.12 closed.

 

 

 

 

 

728x90

'linux' 카테고리의 다른 글

20210429 (목)  (0) 2021.04.29
20210428 (수)  (0) 2021.04.28
20210426 (월)  (0) 2021.04.26
20210423 (금)  (0) 2021.04.23
20210422 (목)  (0) 2021.04.22
Comments