mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
Switching SSH keys to start9 user (#1321)
* Update ssh.rs for start9 user * .ssh directory for uid 1000 user * Update init.rs for start9 user * “His name is Robert Paulson” * typo * just cleaning up ...
This commit is contained in:
@@ -1,12 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Enter the backend directory, copy over the built EmbassyOS binaries and systemd services, edit the nginx config, then create the .ssh directory
|
|
||||||
|
|
||||||
cp target/aarch64-unknown-linux-gnu/release/embassy-init /mnt/usr/local/bin
|
|
||||||
cp target/aarch64-unknown-linux-gnu/release/embassyd /mnt/usr/local/bin
|
|
||||||
cp target/aarch64-unknown-linux-gnu/release/embassy-cli /mnt/usr/local/bin
|
|
||||||
cp *.service /mnt/etc/systemd/system/
|
|
||||||
|
|
||||||
echo "application/wasm wasm;" | sudo tee -a "/mnt/etc/nginx/mime.types"
|
|
||||||
|
|
||||||
mkdir -p /mnt/root/.ssh
|
|
||||||
@@ -125,7 +125,7 @@ pub async fn init(cfg: &RpcContextConfig, product_key: &str) -> Result<(), Error
|
|||||||
tracing::info!("Loaded Package Docker Images");
|
tracing::info!("Loaded Package Docker Images");
|
||||||
}
|
}
|
||||||
|
|
||||||
crate::ssh::sync_keys_from_db(&secret_store, "/root/.ssh/authorized_keys").await?;
|
crate::ssh::sync_keys_from_db(&secret_store, "/home/start9/.ssh/authorized_keys").await?;
|
||||||
tracing::info!("Synced SSH Keys");
|
tracing::info!("Synced SSH Keys");
|
||||||
let db = cfg.db(&secret_store, product_key).await?;
|
let db = cfg.db(&secret_store, product_key).await?;
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ use crate::util::display_none;
|
|||||||
use crate::util::serde::{display_serializable, IoFormat};
|
use crate::util::serde::{display_serializable, IoFormat};
|
||||||
use crate::{Error, ErrorKind};
|
use crate::{Error, ErrorKind};
|
||||||
|
|
||||||
static SSH_AUTHORIZED_KEYS_FILE: &str = "/root/.ssh/authorized_keys";
|
static SSH_AUTHORIZED_KEYS_FILE: &str = "/home/start9/.ssh/authorized_keys";
|
||||||
|
|
||||||
#[derive(Debug, serde::Deserialize, serde::Serialize)]
|
#[derive(Debug, serde::Deserialize, serde::Serialize)]
|
||||||
pub struct PubKey(
|
pub struct PubKey(
|
||||||
|
|||||||
@@ -76,8 +76,11 @@ sudo cp -R frontend/dist/setup-wizard /tmp/eos-mnt/var/www/html/setup
|
|||||||
sudo cp -R frontend/dist/ui /tmp/eos-mnt/var/www/html/main
|
sudo cp -R frontend/dist/ui /tmp/eos-mnt/var/www/html/main
|
||||||
sudo cp index.html /tmp/eos-mnt/var/www/html/index.html
|
sudo cp index.html /tmp/eos-mnt/var/www/html/index.html
|
||||||
|
|
||||||
# Make the .ssh directory
|
# Make the .ssh directory for UID 1000 user
|
||||||
sudo mkdir -p /tmp/eos-mnt/root/.ssh
|
sudo mkdir -p /tmp/eos-mnt/home/$(awk -v val=1000 -F ":" '$3==val{print $1}' /tmp/eos-mnt/etc/passwd)/.ssh
|
||||||
|
sudo mv /tmp/eos-mnt/etc/sudoers.d/010_pi-nopasswd /tmp/eos-mnt/etc/sudoers.d/010_start9-nopasswd
|
||||||
|
sudo sed -i 's/pi/start9/g' /tmp/eos-mnt/etc/sudoers.d/010_start9-nopasswd
|
||||||
|
sudo sed -i 's/ pi / start9 /g' /tmp/eos-mnt/etc/systemd/system/autologin@.service
|
||||||
|
|
||||||
# Custom MOTD
|
# Custom MOTD
|
||||||
sudo rm /tmp/eos-mnt/etc/motd
|
sudo rm /tmp/eos-mnt/etc/motd
|
||||||
|
|||||||
Reference in New Issue
Block a user