All Products
Search
Document Center

Bastionhost:Praktik terbaik untuk mengaudit operasi perintah SCP

Last Updated:Jun 21, 2026

Bastionhost tidak mendukung pengauditan perintah SCP secara langsung. Untuk mengaudit operasi perintah SCP melalui Bastionhost, konfigurasikan ProxyJump pada client lokal Anda sebelum melakukan transfer file. Dengan cara ini, Bastionhost dapat mengaudit operasi perintah SCP tersebut.

Informasi latar belakang

ProxyJump adalah fitur yang diperkenalkan dalam OpenSSH versi 7.3. Setelah Anda mengonfigurasi ProxyJump pada komputer pribadi, client SSH akan terlebih dahulu membuat koneksi aman ke Bastionhost saat menggunakan perintah SCP untuk mengunggah atau mengunduh file. Selanjutnya, client berkomunikasi dengan host target melalui Bastionhost, sehingga memungkinkan Bastionhost mengaudit perintah SCP tersebut.

Prasyarat

Konfigurasi ProxyJump

  1. Login ke sistem Linux lokal Anda.

  2. Jalankan perintah berikut untuk membuat dan mengonfigurasi file config di direktori .ssh.

    vim ~/.ssh/config

    Gunakan konfigurasi berikut:

    #-------Bastionhost configuration---------#
    # Bastionhost alias
    Host bastion
        # Bastionhost O&M address
        HostName ****-public.bastionhost.aliyuncs.com 
        # Default Bastionhost port 60022
        Port 60022 
        # Bastionhost user
        User bastion-user
    #-------Host configuration---------#
    # Host alias
    Host target-host-A 
        # IP address of the host registered in Bastionhost
        HostName 192.168.XX.XX 
        # Host username
        User tagert-user
        # Configure ProxyJump. When you run an SCP command, the client first connects to bastion, then connects to target-host-A through bastion
        ProxyJump bastion 
    #--------You can configure multiple hosts--------#
    #Host target-host-B
    #    HostName 192.168.XX.XX 
    #    User tagert-user
    #    ProxyJump bastion 
  3. Gunakan perintah SCP untuk mengunggah file ke host target atau mengunduh file ke mesin lokal Anda. Berikut beberapa contohnya:

    • Contoh: Mengunggah file ke host target

      Perintah ini mengunggah file lokal file-name.txt ke direktori home pada host target (target-host-A).

      scp /file-name.txt target-host-A:/home/
    • Contoh: Mengunduh file ke mesin lokal

      Perintah ini mengunduh file file-name.txt dari host target (target-host-A) ke direktori home lokal.

      scp target-host-A:/file-name.txt /home/

Lihat catatan audit Bastionhost

Login ke Bastionhost untuk melihat catatan audit operasi perintah SCP. Untuk informasi selengkapnya, lihat Search for and view sessions.

Di halaman audit sesi, klik tab File transfer untuk melihat catatan audit perintah SCP. Catatan tersebut mencakup bidang seperti waktu, IP host atau hostname, pengguna, IP sumber, tipe (misalnya Upload file atau Download file), dan konten (nama file). Anda dapat melakukan pencarian berdasarkan waktu, kata kunci, IP host, nama pengguna, atau kriteria lainnya.