์๊ฒฉ์ผ๋ก ์ ์์ ํ๋ค ๋ณด๋ฉด, ์ผ์ ์๊ฐ ๋์ ํค ์ ๋ ฅ์ด ์์ ๋ ์๊ฒฉ ์ ์์ด ์ข ๋ฃ ๋๋ค.
๊ธธ๊ฒ๋ 24์๊ฐ ์งง๊ฒ๋ 300์ด๋ฉด ์ ์์ด ์ข ๋ฃ๋๋ค.
โ linux user ๋ชจ๋์๊ฒ ์ ์ฉํ๊ณ ์ถ๋ค๋ฉด,
$ vi /etc/ssh/ssh_config
โ ์ง๊ธ ์ฌ์ฉ์ค์ธ user์๊ฒ๋ง ์ ์ฉํ๊ณ ์ถ๋ค๋ฉด,
$ vi ~/.ssh/config
๐ก ํ์ผ์ ์ถ๊ฐ ํน์ ์์ ํด ์ฃผ๋ฉด ๋๋๋ฐ ๋ง์ฝ์ ์ ์์น์ ํด๋น ํ์ผ์ด ์๋ค๋ฉด ์์ฑ ํ ๋ด์ฉ์ ์ถ๊ฐํด ์ฃผ๋ฉด ๋๋ค.
Insert the following:
Host *
ServerAliveInterval 300
ServerAliveCountMax 2
์ฌ๊ธฐ์ ServerAliveInterval์ ๋จ์๋ sec์ด๋ฉฐ ServerAliveCountMax์ ๊ฐฏ์๋ ์ด์์๋ค๊ณ ๋ณด๋ผ ๋ฉ์์ง์ ์ ์ด๋ค.
์ฆ, 300์ด ๋จ์๋ก 2๊ฐ์ ํจํท์ ์๋ฒ์ธก์ ์์ง ์ ์์ด ์ ํจํ๋ค๋ ์๋ฏธ๋ก ๋ณด๋ธ๋ค.
ServerAliveCountMax
Sets the number of server alive messages (see below) which may be sent without ssh(1) receiving any messages back from the server. If this threshold is reached while server alive messages are being sent, ssh will disconnect from the server, terminating the session. It is important to note that the use of server alive messages is very different from TCPKeepAlive (below). The server alive messages are sent through the encrypted channel and therefore will not be spoofable. The TCP keepalive option enabled by TCPKeepAlive is spoofable. The server alive mechanism is valuable when the client or server depend on knowing when a connection has become inactive.
The default value is 3. If, for example, ServerAliveInterval (see below) is set to 15 and ServerAliveCountMax is left at the default, if the server becomes unresponsive, ssh will disconnect after approximately 45 seconds. This option applies to protocol version 2 only; in protocol version 1 there is no mechanism to request a response from the server to the server alive messages, so disconnection is the responsibility of the TCP stack.
ServerAliveInterval
Sets a timeout interval in seconds after which if no data has been received from the server, ssh(1) will send a message through the encrypted channel to request a response from the server. The default is 0, indicating that these messages will not be sent to the server, or 300 if the BatchMode option is set. This option applies to protocol version 2 only. ProtocolKeepAlives and SetupTimeOut are Debian-specific compatibility aliases for this option.
๋ง์ฝ Open SHH ์๋ฒ๊ฐ ํด๋ผ์ด์ธํธ์์ ๋ชจ๋ ์ฐ๊ฒฐ์ ์ ์งํ๋๋ก ํ๋ ค๋ฉด ์๋ ํ์ผ์ ๋ด์ฉ์ ์ถ๊ฐํฉ๋๋ค.
$ vi /etc/ssh/sshd_config
Edit or Insert the following:
ClientAliveInterval 300
ClientAliveCountMax 2
SSH ํด๋ผ์ด์ธํธ ๋๋ ์๋ฒ๊ฐ ์๋์๊ฒ 300์ด ๋จ์๋ก 2๋ฒ์ ์ฐ๊ฒฐํ์ธ์ ํฉ๋๋ค.
2๋ฒ์ ์ฐ๊ฒฐํ์ธ ๋ ์๋ต์ ๋ฐ์ง ๋ชปํ๋ฉด ์ฐ๊ฒฐ์ ๋์ด์ง๋๋ค.
Thanks for
'OS > ๐ง Linux' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
๐ง Ubuntu * ํ์ผ์ rm ๋ง๊ณ ํด์งํต์ผ๋ก ์์ ํ๊ฒ ๋ณด๋ ์๋ค.. ์ฅฌ๋ฅต (0) | 2020.03.04 |
---|---|
๐ง Ubuntu * ํ๊ฒฝ๋ณ์ ์ ์ฉ ๋ฐ ํฐ๋ฏธ๋ ์ข ๋ฃ ํ์๋ ์ ์งํ๋ ๋ฐฉ๋ฒ ! (0) | 2020.03.04 |
๐ง Ubuntu * ํฐ๋ฏธ๋์์ ์น ๋ธ๋ผ์ฐ์ (chrome) ์ด๊ธฐ (0) | 2020.03.04 |
๐ง Ubuntu * zip ์์ถ, ์์ถ ํ๊ธฐ (0) | 2020.03.04 |
โ Solved * [Ubuntu] '\r':command not found (0) | 2020.03.04 |