Skip to main content

macOS and Linux platform specifics

Due to security issues, SSH does not support putting a password on the command line. To avoid having to enter a password manually at each step of the script, you need to enable key-based SSH authorization for the target user. Simply add the key of the computer where the script is executed to ~/.ssh/id_rsa.pub to hosts's ~/.ssh/authorized_keys of the target computer to be scanned.

note
  • SSH connections must be enabled both for target and host executing commands.

  • Port 22/tcp needs to be open.

Remote copy mode: macOS and Linux specific commands

On the computer that will run the script for remote scan:

  1. Copy the files snowagent and snowagent.config to the current folder (copy from an existing agent installation). If Oracle inventory option is to be used, place sios.jar in the same folder.

  2. Example script:

    ssh <USER>@<REMOTE_MACHINE> mkdir -p <TEMP_DIR>
    scp snowagent <USER>@<REMOTE_MACHINE>:<TEMP_DIR>
    scp snowagent.config <USER>@<REMOTE_MACHINE>:<TEMP_DIR>/snowagent.config
    ssh <USER>@<REMOTE_MACHINE> chmod 700 <TEMP_DIR>/snowagent
    ssh -t <USER>@<REMOTE_MACHINE> 'cd <TEMP_DIR>; sudo ../snowagent'
    ssh -t <USER>@<REMOTE_MACHINE> 'sudo rm -rf <TEMP_DIR>'

    Where:

    ParameterDescription
    <REMOTE_MACHINE>IP address or DNS name of the remote machine.
    <USER>User that will execute the commands.
    <TEMP_DIR>Temporary folder where the agent files will be copied to, for example /tmp/snowagent.
  3. If Oracle inventory scan is required, add the following command to the script after copying snowagent.config:

    scp sios.jar <USER>@<REMOTE_MACHINE>:<TEMP_DIR>/sios.jar
  4. If a server endpoint is not configured, run snowagent with only scan option and then retrieve result files from the machine:

    ssh -t <USER>@<REMOTE_MACHINE> 'cd <TEMP_DIR>; sudo ../snowagent scan'
    scp -rp <USER>@<REMOTE_MACHINE>:<TEMP_DIR>/data ..

Net share mode

Linux (Debian and RHEL based) specific commands

note

In addition to previously mentioned requirements, the package cifs-utils and its prerequisites must be installed.

On the computer that will run the script for remote scan:

  1. Copy the files snowagent and snowagent.config to the shared network folder

    \\<NET_SHARE_ADDRESS>\<NET_SHARE_FOLDER> (copy from an existing agent installation).

    If Oracle inventory option is to be used, place sios.jar in the same folder.

    The recommendation is to create a separate folder for each agent variation (32- and 64-bit). In this example, we assume that 32-bit snowagent is to be put in the following folder:

    \\<NET_SHARE_ADDRESS>\<NET_SHARE_FOLDER>\linux32\

  2. Example script:

    ssh <USER>@<REMOTE_MACHINE> mount.cifs //<NET_SHARE_ADDRESS>/<NET_SHARE_FOLDER> <TEMP_DIR> -o user=guest,password= rw

    ssh <USER>@<REMOTE_MACHINE> mkdir <TEMP_DIR>/linux32/<TARGET_NAME>

    ssh <USER>@<REMOTE_MACHINE> cd <TEMP_DIR>/linux32/<TARGET_NAME>; sudo ../snowagent

    ssh <USER>@<REMOTE_MACHINE> 'cd <TEMP_DIR>/../; umount <MOUNT_LOCATION>'

    Where:

    ParameterDescription
    <REMOTE_MACHINE>IP address or DNS name of the remote machine.
    <USER>User that will execute the commands.
    <NET_SHARE_ADDRESS>Host name or IP address of the machine that hosts the shared folder.
    <NET_SHARE_FOLDER>Name of the shared folder on the <NET_SHARE_ADDRESS> machine.
    <TEMP_DIR>Temporary folder which the shared network folder will be mounted to, for example /tmp/snowagent.
  3. If a server endpoint is not configured, run snowagent with only scan option:

    ssh <USER>@<REMOTE_MACHINE> cd '<TEMP_DIR>/linux32/<TARGET_NAME>; sudo ../snowagent scan'

macOS specific commands

On the computer that will run the script for remote scan:

  1. Copy the files snowagent and snowagent.config to the shared network folder

    \\<NET_SHARE_ADDRESS>\<NET_SHARE_FOLDER> (copy from an existing agent installation).

    If Oracle inventory option is to be used, place sios.jar in the same folder.

    In this example, we assume that 32-bit snowagent is to be put in the following folder:

    \\<NET_SHARE_ADDRESS>\<NET_SHARE_FOLDER>\osx\

  2. Example script:

    ssh <USER>@<REMOTE_MACHINE> mount -o rw -t smbfs //guest:@<NET_SHARE_ADDRESS>/<NET_SHARE_FOLDER> <TEMP_DIR>

    ssh <USER>@<REMOTE_MACHINE> mkdir <TEMP_DIR>/osx/<TARGET_NAME>

    ssh <USER>@<REMOTE_MACHINE> cd '<TEMP_DIR>/osx/<TARGET_NAME>; sudo ../snowagent'

    ssh <USER>@<REMOTE_MACHINE> 'cd < TEMP_DIR >/../; umount <MOUNT_LOCATION>'

    Where:

    ParameterDescription
    <REMOTE_MACHINE>IP address or DNS name of the remote machine.
    <USER>User that will execute the commands.
    <NET_SHARE_ADDRESS>Host name or IP address of the machine that hosts the shared folder.
    <NET_SHARE_FOLDER>Name of the shared folder on the <NET_SHARE_ADDRESS> machine.
    <TEMP_DIR>Temporary folder which the shared network folder will be mounted to, for example /tmp/snowagent.
  3. In the case a server endpoint is not configured, run snowagent with only scan option:

    ssh <USER>@<REMOTE_MACHINE> 'cd <TEMP_DIR>/osx/<TARGET_NAME>; sudo ../snowagent scan'