hostedpi ssh command

Get the SSH command to connect to a Raspberry Pi server

Usage: hostedpi ssh command [OPTIONS] NAME

Arguments

name [str]

Name of the Raspberry Pi server to get the SSH command for

Options

--ipv6

Use the IPv6 connection method

--numeric -n

Use the IPv6 address instead of the hostname

--username -u [str]

The username to use when connecting

--no-user

Don’t include a username in SSH command

--help

Show this message and exit

Usage

Output the default IPv4 SSH command for a Pi:

$ hostedpi ssh command mypi
ssh -p 5091 root@ssh.mypi.hostedpi.com

Output the IPv4 SSH command for a Pi, with a custom username:

$ hostedpi ssh command mypi --username pi
ssh -p 5091 pi@ssh.mypi.hostedpi.com

Output the IPv4 SSH command for a Pi, with no specified username:

$ hostedpi ssh command mypi --no-user
ssh -p 5091 ssh.mypi.hostedpi.com

Output the IPv6 SSH command for a Pi:

$ hostedpi ssh command mypi --ipv6
ssh root@mypi.hostedpi.com

Warning

You will need IPv6 connectivity to connect using the IPv6 address.

Output the IPv6 SSH command for a Pi, with a custom username and numeric address:

$ hostedpi ssh command mypi --ipv6 --numeric --username pi
ssh pi@[2a00:1098:8:14b::1]

Note

You will need to have an SSH key on the Pi to be able to connect. This can be done when the Pi is provisioned with hostedpi create or added later with hostedpi ssh keys add.

SSH directly onto a Pi:

$ $(hostedpi ssh command mypi)

Warning

This will not work if HOSTEDPI_LOG_LEVEL is set to DEBUG as the logging output will obscure the SSH command.