# Command line peer to peer initiator script for Linux and macOS

**URL:** <https://forum.remote.it/t/command-line-peer-to-peer-initiator-script-for-linux-and-macos/50>\
**Category:** Peer to Peer\
**Created:** [June 6, 2019, 12:10am UTC](https://forum.remote.it/t/command-line-peer-to-peer-initiator-script-for-linux-and-macos/50 "2019-06-06T00:10:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gary](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@gary](https://forum.remote.it/u/gary)\
**Post date:** [June 6, 2019, 12:10am UTC](https://forum.remote.it/t/command-line-peer-to-peer-initiator-script-for-linux-and-macos/50/1 "2019-06-06T00:10:09Z")

</div>

You can learn about the differences between proxy and peer to peer (P2P) connections here: [https://docs.remote.it/peer-to-peer-p2p-vs.-proxy-connections](https://docs.remote.it/peer-to-peer-p2p-vs.-proxy-connections)

and you can learn about the details of using the connectd daemon directly (on the command line or inside your own connection programs) to initiate peer to peer connections here: [https://docs.remote.it/guides/using-connectd-in-p2p-initiator-mode](https://docs.remote.it/guides/using-connectd-in-p2p-initiator-mode)

The p2p-init.sh script which you can find [here](https://github.com/remoteit/command-line) is a step above running the daemon directly on the command line, as it lets you simply log into your account with your username and password, and request a P2P connection to any service by name instead of by UID.

Review the [README.md](https://github.com/remoteit/command-line/blob/master/README.md) file for info on downloading and running this program.

Also, the connection info is cached after the first time you make a connection, so that subsequent connections to the same remote.it service both use the same localhost port and don’t reqquire downloading of the device list, which saves time.

SSH connections will be established and then the SSH session will be initiated. For all other protocols, a connection address of the form 127.0.0.1:port will be generated and displayed. Use this connection info in your browser, VNC client, or other app. When you are done with the connection, hit the Enter key and it will disconnect.
