Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOISSUE - Enable SSH #33

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions hal/buildroot/linux/configs/cube_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,10 @@ BR2_TARGET_GENERIC_ROOT_PASSWD="m2N2Lfno"
BR2_PACKAGE_HOST_MKPASSWD=y

BR2_PACKAGE_HTOP=y

# SSH
BR2_PACKAGE_OPENSSH=y
BR2_PACKAGE_OPENSSH_CLIENT=y
BR2_PACKAGE_OPENSSH_SERVER=y
BR2_PACKAGE_OPENSSH_KEY_UTILS=y
BR2_PACKAGE_OPENSSH_SANDBOX=y
4 changes: 2 additions & 2 deletions hal/buildroot/qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function start_qemu(){
-cpu $CPU_TYPE \
-machine q35 \
-enable-kvm \
-netdev user,id=vmnic,hostfwd=tcp::6191-:80,hostfwd=tcp::6192-:443,hostfwd=tcp::6193-:3001,dns=8.8.8.8 \
-netdev user,id=vmnic,hostfwd=tcp::6190-:22,hostfwd=tcp::6191-:80,hostfwd=tcp::6192-:443,hostfwd=tcp::6193-:3001,dns=8.8.8.8 \
-device virtio-net-pci,disable-legacy=on,iommu_platform=true,netdev=vmnic,romfile= \
-nographic \
-no-reboot \
Expand All @@ -74,7 +74,7 @@ function start_cvm(){
-cpu $CPU_TYPE \
-machine q35 \
-enable-kvm \
-netdev user,id=vmnic,hostfwd=tcp::6191-:80,hostfwd=tcp::6192-:443,hostfwd=tcp::6193-:3001,dns=8.8.8.8 \
-netdev user,id=vmnic,hostfwd=tcp::6190-:22,hostfwd=tcp::6191-:80,hostfwd=tcp::6192-:443,hostfwd=tcp::6193-:3001,dns=8.8.8.8 \
-device virtio-net-pci,disable-legacy=on,iommu_platform=true,netdev=vmnic,romfile= \
-nographic \
-no-reboot \
Expand Down
43 changes: 43 additions & 0 deletions hal/buildroot/ssh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# SSH Configuration For Cube AI

## Overview

Cube AI uses a SSH to enable remote access to the VM. By default, the SSH server does not allow root login. You can either enable root login or create a new user with a specific password. This also allows you to copy files to the VM.

## Add new user

```bash
adduser --gecos "[your name]" --shell /bin/bash <username>
```

For example:

```bash
adduser --gecos "Rodney Osodo" --shell /bin/bash rodneyosodo
```

## Enable SSH root login

Edit the `/etc/ssh/sshd_config` file and add the following line:

```bash
PermitRootLogin yes
```

Save the file and restart the SSH server:

```bash
systemctl restart sshd
```

## To copy files to the VM

```bash
scp -P 6190 <local_file> <username>@<vm_ip>:<remote_file>
```

For example:

```bash
scp -P 6190 test.txt rodneyosodo@localhost:/home/rodneyosodo
```