code: func onSCP(scpFlags *scp.Flags) (err error) {
  	// when 'teleport scp' is executed, it cannot write logs to stderr (because
  	// they're automatically replayed by the scp client)
  	utils.SwitchLoggingtoSyslog()
  	if len(scpFlags.Target) == 0 {
  		return trace.BadParameter("teleport scp: missing an argument")
  	}
  
  	// get user's home dir (it serves as a default destination)
  	user, err := user.Current()
  	if err != nil {
  		return trace.Wrap(err)
  	}
  	// see if the target is absolute. if not, use user's homedir to make
  	// it absolute (and if the user doesn't have a homedir, use "/")
  	target := scpFlags.Target[0]
  	if !filepath.IsAbs(target) {
  		if !utils.IsDir(user.HomeDir) {
  			slash := string(filepath.Separator)
  			scpFlags.Target[0] = slash + target
  		} else {
  			scpFlags.Target[0] = filepath.Join(user.HomeDir, target)
  		}
  	}
  	if !scpFlags.Source && !scpFlags.Sink {
  		return trace.Errorf("remote mode is not supported")
  	}
  
  	scpCfg := scp.Config{
  		Flags:       *scpFlags,
  		User:        user.Username,
  		RunOnServer: true,
  	}
  
  	cmd, err := scp.CreateCommand(scpCfg)
  	if err != nil {
  		return trace.Wrap(err)
  	}
  
  	return trace.Wrap(cmd.Execute(&StdReadWriter{}))
  }
docs: // onSCP implements handling of 'scp' requests on the server side. When the teleport SSH daemon
  // receives an SSH "scp" request, it launches itself with 'scp' flag under the requested
  // user's privileges
  //
  // This is the entry point of "teleport scp" call (the parent process is the teleport daemon)