CentOS ์ค์นํ ๋ ๋คํธ์ํฌ ์ค์ ์ ๋์ผ๋ก ํ๋ค๋ฉด ์๊ด์๋ ์ผ์ด์ง๋ง...
๋ฌด์ ๋์ผ๋ก ์ฐ๊ฒฐ์ ํ์๋
ifconfig๋ ip addr ๋ช ๋ น์ด๋ก inet ip ์ฃผ์๊ฐ ํ์ธ์ด ์๋๋ ๊ฒฝ์ฐ๊ฐ์๋ค.
์๋ฒ๊ฐ ๋ถํ ๋ ๋ ip๋ฅผ ๋ง๋ค์ด์ฃผ๋ ์ค์ ์ ๋ฐ๊ฟ์ค๊ฑฐ๋ค.
CentOS 7์ ๊ธฐ๋ณธ ๋คํธ์ํฌ ์ธํฐํ์ด์ค๊ฐ enp0s3๋ก ๋์ด์๋ค.
์ด๋ฆ์ด ๋ค๋ฅผ์๋ ์์ผ๋ ํ์ธ ํ ๊ฒ.
1 2 3 4 | [jamong@localhost ~]$ su ์ํธ: [root@localhost jamong]# cd /etc/sysconfig/network-scripts/ [root@localhost network-scripts]# vi ifcfg-enp0s3 | cs |
์ ํ์ผ๋ก ๋ค์ด๊ฐ๋ฉด ์ค์ ์ค์ ONBOOT=no ๋ก ๋์ด ์์๊ฒ์ด๋ค.
yes๋ก ๋ฐ๊ฟ์ฃผ๊ณ ์ ์ฅํ๋ค.
๋คํธ์ํฌ๋ฅผ ์ฌ์คํ ํด์ฃผ๊ณ ip๋ฅผ ํ์ธํ๋ค.
1 2 | [root@localhost network-scripts]# service network restart [root@localhost network-scripts]# ifconfig | cs |
inet์ผ๋ก ip๊ฐ ์์ฑ๋๊ฒ์ ํ์ธํ ์ ์๋ค.
local ip๋ฅผ ํ์ธํ์ผ๋....
ํธ๋ฆฌํ ๊ฐ๋ฐํ๊ฒฝ์ ์ํด ssh์ ์ ์ธํ ์ ํ ๊ฒ์ด๋ค.
yum์ ์ด์ฉํด์ ํจํค์ง ๋ช๊ฐ๋ฅผ ์ค์นํ๋ค.
1 2 3 | [root@localhost network-scripts]# exit [jamong@localhost ~]$ sudo yum install openssh-server openssh-clients openssh-askpass | cs |
ssh์ default ์ ์ ํฌํธ๋ 22์ด๋ค.
๋ง์ฝ ๋ฐ๊ฟ๊ณ ์ถ๋ค๋ฉด /etc/ssh/sshd_config ํ์ผ์ PORT=22 ์ฃผ์์ ํด์ ํ๊ณ ์ํ๋ ํฌํธ๋ฅผ ์ ๋ ฅํด๊ณ ์ ์ฅํ๋ค.
์ค์น๋ ์๋ฃ ๋์๊ณ , ์ด์ ๋ ๋ฐฉํ๋ฒฝ ํฌํธ๋ฅผ ์ด์ด์ฃผ๋ฉด ๋๋ค.
1 2 3 4 5 6 | [jamong@localhost ~]$ sudo firewall-cmd --zone=public --add-port=22/tcp --permanent success [jamong@localhost ~]$ sudo firewall-cmd --reload success [jamong@localhost ~]$ sudo firewall-cmd --list-ports 22/tcp |
์ธํ ์ ๋๋ฌ๊ณ ์ธ๋ถ์์ ์ ์์ด ๋๋์ง ํ์ธํ๋ฉด ๋๋ค.
์๋์ฐ ์ด์์ฒด์ ๋ฅผ ์ฌ์ฉํ๊ณ ์๋ค๋ฉด putty๋ฅผ ์ค์นํ์ฌ ์ ์์ ํ๋ฉด ๋๋ค.
https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
ํ์๋ ๋งฅ์ผ๋ก ์ ์์ ํ ๊ฑฐ๋ค.
1 2 3 4 | Jamong@macui-MacBook-Pro ๎ฐ ~ ๎ฐ ssh jamong@192.168.0.14 jamong@192.168.0.14's password: Last login: Sat Aug 25 12:13:20 2018 from 192.168.0.11 [jamong@localhost ~]$ |
์ ์์ ์ฑ๊ณตํ๊ฒ์ ํ์ธํ ์ ์๋ค.
์ด์ ๋ ๋ณธ๊ฒฉ์ ์ผ๋ก ์๋ฒ์ ํ์ํ ๊ฒ๋ค์ ์ค์นํ ๊ฑฐ๋ค.
๋๊ธ