Is there an easier way to enable remote ssh root login in the installer ?

shodan

Active Member
Sep 1, 2022
234
64
33
Hi,

When I run the proxmox installer, I prefer to do that remotely

So, I type the following, fully by hand in the console

Code:
apt update ; apt install openssh-server -y ; echo "permitrootlogin yes" >> /etc/ssh/sshd_config ; printf "%s\n" "root:qwerty" | chpasswd ; /etc/init.d/ssh restart

And after the 20th time I find this is getting tedious !

Is there an easier way ?

Maybe there's a script already on the installer that I just didn't find yet ? Like "enable-root-ssh" ?
 
Hi,
have you considered using the auto-install-assistent and provide an answer file with the configuration details, already?
https://pve.proxmox.com/wiki/Automated_Installation
Thanks, that will be useful

For now I setup web infrastructure and as @wolframio suggested, I'm using that as shorthand to download and run the script like this

Bash:
wget router.lan/erl ; sh erl

much easier to type by hand at least !
 
  • Like
Reactions: wolframio
try this, put a preseed file on a web server with this inside :

Code:
### Locale and keyboard (minimal, required)
d-i debian-installer/language string en
d-i debian-installer/country string US
d-i debian-installer/locale string en_US.UTF-8
d-i keyboard-configuration/xkb-keymap select us

### Network: automatic (DHCP)
d-i netcfg/choose_interface select auto
d-i netcfg/disable_autoconfig boolean false
d-i netcfg/get_hostname string debian
d-i netcfg/get_domain string unassigned-domain

### Enable SSH installer (network-console)
d-i anna/choose_modules string network-console
d-i network-console/start boolean true

### SSH access credentials (REQUIRED)
### Change this username
d-i network-console/username string installer

### You MUST provide one of these:
### Option 1: plain text password (simple, less secure)
d-i network-console/password password changeme
d-i network-console/password-again password changeme

### Option 2: encrypted password (recommended)
# d-i network-console/password-crypted password $6$HASH_GOES_HERE

### Do NOT auto-install anything else
d-i preseed/late_command string true

then boot the install with:

Code:
auto=true priority=critical preseed/url=http://SERVER_URL/preseed_file.cfg

you can edit the ISO to auto boot with that line.

Also you can put de preseed file on the ISO itself
 
Last edited: