This directory contains scripts for setting up SSH access and direct connection to Raspberry Pi devices.
Sets up SSH key authentication for a Raspberry Pi.
./setup_ssh_key.sh <username> <raspberry-pi-ip>- Generates SSH key pair if not exists
- Copies public key to Raspberry Pi
- Tests SSH connection
- Configures SSH config file for easy access
- SSH access to Raspberry Pi
- Password authentication enabled
- Sudo privileges on Raspberry Pi
Configures direct connection to a Raspberry Pi using a USB-C cable.
./setup_direct_connection.sh <username> <raspberry-pi-ip>- Configures USB-C connection
- Sets up network interface
- Tests connection
- Configures SSH for direct connection
- USB-C cable connected between host and Raspberry Pi
- SSH access to Raspberry Pi
- Sudo privileges on Raspberry Pi
setup/
├── setup_ssh_key.sh # SSH key setup script
└── setup_direct_connection.sh # Direct connection setup script
- Run the SSH key setup script:
./setup_ssh_key.sh <username> <raspberry-pi-ip>-
Enter your password when prompted
-
Verify the connection:
ssh <username>@<raspberry-pi-ip>-
Connect Raspberry Pi to host using USB-C cable
-
Run the direct connection script:
./setup_direct_connection.sh <username> <raspberry-pi-ip>- Test the connection:
ssh <username>@raspberrypi.local-
SSH Key Setup Failures
- Check SSH service is running on Raspberry Pi
- Verify password authentication is enabled
- Check SSH key permissions
-
Direct Connection Issues
- Verify USB-C cable is properly connected
- Check network interface configuration
- Ensure mDNS is working (raspberrypi.local)
-
Permission Errors
- Ensure user has sudo privileges
- Check SSH key permissions
- Verify SSH config file permissions
- SSH connection logs:
ssh -v <username>@<raspberry-pi-ip> - System logs:
sudo journalctl -xe - Network logs:
ifconfigorip addr