SSH Push 연락 방법

SSH Push (ssh-push) is used in environments where Salt clients cannot reach the SUSE Multi-Linux Manager Server directly. In this environment, clients are located in a firewall-protected zone called a DMZ. No system within the DMZ is authorized to open a connection to the internal network where the SUSE Multi-Linux Manager Server is located.

SSH Push는 SUSE Multi-Linux Manager에서 클라이언트로만 터널을 열지만, 역방향 채널은 직접 이동합니다. 이러한 시나리오는 일부 위치에서는 작동하지 않을 수 있습니다. 따라서 SSH Push(터널 포함)도 연락 방법으로 사용할 수 있습니다. 또한 역방향 터널이 열리므로 클라이언트에서 서버로의 연결을 차단할 수 있는 모든 방화벽을 통과하여 통신할 수 있습니다.

SSH 푸시는 클라이언트에 데몬 에이전트를 설치할 수 없는 경우에도 사용할 수 있습니다.

The SSH Push method has serious limitations. It does not scale well, and consumes more Server resources and network bandwidth than the plain Salt method (default). The Push SSH method is not at all supported with large setups (1000 clients and more).

서버는 SSH Push를 사용하여 정기적으로 클라이언트에 연락해 체크인하고 예약된 작업과 이벤트를 수행합니다.

프로비저닝 모델을 사용하여 시스템을 다시 설치하는 것은 현재 SSH Push로 관리되는 클라이언트에서는 지원되지 않습니다.

This image demonstrates the SSH Push process path. All items left of the Taskomatic block represent processes running on the SUSE Multi-Linux Manager client.

salt ssh contact taigon

To use SSH Push, you must have the SSH daemon running on the client, and reachable by the salt-api daemon running on the SUSE Multi-Linux Manager Server. Additionally, the required Python version will be deployed with the Salt Bundle on the client system.

다음 등록 절차를 시작하기 전에 SSH 푸시 연락 방법을 구성하여 활성화 키를 정의합니다. 이 방법에서는 서버에 HTTPS로 직접 연결해야 합니다.

이러한 클라이언트를 SUSE Multi-Linux Manager 서버에 등록하려면 Web UI 또는 API를 사용해야 합니다. 다음 절차 또는 예제를 참조하십시오.

절차: SSH Push를 사용하여 클라이언트 등록
  1. SUSE Multi-Linux Manager Web UI에서 시스템  부트스트랩으로 이동하여 해당 필드를 완성합니다.

  2. SSH Push 연락 방법이 구성된 활성화 키를 선택합니다. 활성화 키에 대한 자세한 내용은 활성화 키에서 확인할 수 있습니다.

  3. Check the Manage system completely via SSH checkbox.

  4. 부트스트랩을 클릭하여 등록을 시작합니다.

  5. 시스템  개요로 이동하여 시스템이 올바르게 등록되었는지 확인합니다.

예: SSH를 통한 푸시에 대한 API 액세스

You can use the API to manage which contact method to use. This example Python code sets the contact method to ssh-push.

유효한 값은 다음과 같습니다.

  • default(풀)

  • ssh-push

  • ssh-push-tunnel

client = xmlrpclib.Server(MLM_HOST + "/rpc/api", verbose=0)
key = client.auth.login(MLM_LOGIN, MLM_PASSWORD)
client.system.setDetails(key, 1000012345, {'contact_method' : 'ssh-push'})

1. 사용 가능한 파라미터

SSH Push를 구성할 때 호스트, 활성화 키, 비밀번호 등 시스템의 등록 시에 사용되는 파라미터를 수정할 수 있습니다. 비밀번호는 부트스트랩에만 사용되며 어디에도 저장되지 않습니다. 향후 모든 SSH 세션은 키/인증서 쌍을 통해 인증됩니다. 이러한 파라미터는 시스템  부트스트래핑에서 구성할 수 있습니다.

또한 시스템 전체에 사용되는 영구 파라미터를 구성할 수 있으며, sudo 사용자가 루트 대신 권한 없는 사용자로 시스템에 액세스하도록 설정할 수도 있습니다.

Use mgrctl term before running steps inside the server container.

절차: 권한 없는 SSH 액세스 구성
  1. Ensure you have the latest spacewalk-taskomatic and spacewalk-certs-tools packages installed on the SUSE Multi-Linux Manager Server.

  2. 각 클라이언트 시스템에서 적절한 권한 없는 사용자를 생성합니다.

  3. On each client system, edit the sudoers file:

    sudo visudo
  4. Grant sudo access to the user by adding this line at the end of the sudoers file. Replace <user> with the name of the user that is bootstrapping the client in the Web UI:

    <user>  ALL=NOPASSWD: /usr/bin/python3, /var/tmp/venv-salt-minion/bin/python

    This procedure grants root access without requiring a password, which is required for registering the client. When the client is successfully installed it runs with root privileges, so the access is no longer required. We recommend that you remove the line from the sudoers file after the client has been successfully installed.

  5. Inside the SUSE Multi-Linux Manager Server container, edit the /etc/rhn/rhn.conf configuration file, and add or amend this line to include the unprivileged username:

    ssh_push_sudo_user = <user>
  6. After changing this configuration parameter you must restart services such as salt-secrets-config.service, tomcat.service, and taskomatic.service. 필요한 모든 서비스를 처리하려면 루트 권한으로 SUSE Multi-Linux Manager 서버를 다시 시작하는 것이 가장 좋습니다. 컨테이너 외부의 컨테이너 호스트에서 다음을 입력합니다.

    mgradm restart

2. 작업 실행

The SSH Push feature uses taskomatic to execute scheduled actions using salt-ssh. The taskomatic job periodically checks for scheduled actions and executes them. The SSH Push feature executes a complete salt-ssh call based on the scheduled action.

By default, twenty Salt SSH actions can be executed at a time. You can increase the number of actions that can be executed in parallel, by adding these lines to your configuration file, and adjusting the value of parallel_threads upwards. We recommend you keep the number of parallel actions low, to avoid problems:

taskomatic.sshminion_action_executor.parallel_threads = <number>
org.quartz.threadPool.threadCount = <value of parallel_threads + 20>

이렇게 하여 어느 한 곳의 클라이언트에서 병렬로 실행할 수 있는 작업의 수와 Taskomatic이 사용하는 작업자 스레드의 총 개수를 조정할 수 있습니다. 작업을 여러 클라이언트에서 실행해야 하는 경우 작업은 항상 각 클라이언트에서 순차적으로 실행됩니다.

If the clients are connected through a proxy, you need to adjust the MaxSessions settings on the proxy. In this case, set the number of parallel connections to be three times the total number of clients.

3. 향후 출시될 기능

SSH Push를 통한 푸시에서는 아직 지원하지 않는 몇 가지 기능이 있습니다. 다음 기능은 Salt SSH 클라이언트에서 작동하지 않습니다.

  • OpenSCAP 감사

  • Beacons로 인해 다음 결과가 발생합니다.

    • Installing a package on a system using zypper does not invoke the package refresh.

    • 가상 호스트 기능(예: 게스트에 대한 호스트)은 가상 호스트 시스템이 Salt SSH 기반인 경우 작동하지 않습니다.

자세한 내용은 다음을 참조하십시오.