Create a folder with name Jenkins inside your machine and then download the agent.jar and slave agent.jnlp and copy it to your instance then try to run the command with sudo in front of it and wait until it shows connected.
Hope this helps.
For more information, check out this jenkins tutorial.