# SFTP Notes

[MDR Project Onboarding](https://github.xdr.accenturefederalcyber.com/MDR-Content/mdr-content/wiki/MDR-Project-Onboarding)

get = downloads a file
put = uploads a file
cd = change directory on server
lcd = change local directory (on client) 
pwd = print wd
ls = ls

```
#!/usr/bin/env bash
#
#
# sftp_as2 afs-splunk-sh splunk

REMOTE_HOST=$1
REMOTE_USER=$2

SFTP_SUBSYSTEM="/usr/libexec/openssh/sftp-server"

function usage {

echo "sftp_as afs-splunk-sh splunk"

}

if [[ $# -ne 2 ]]; then
    usage
    exit 1
fi

```
And the command

`sftp -s "sudo -i -u $REMOTE_USER $SFTP_SUBSYSTEM" $REMOTE_HOST`