Skip to content

Commit

Permalink
Merge pull request #33 from ultravioletrs/ssh
Browse files Browse the repository at this point in the history
NOISSUE - Enable SSH
  • Loading branch information
drasko authored Nov 1, 2024
2 parents cae0a2f + 352d16c commit 1ece713
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 2 deletions.
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
```

0 comments on commit 1ece713

Please sign in to comment.