radxa-repo / rbuild

Radxa Image Builder (Maintenance mode)
https://radxa-repo.github.io/rbuild/
GNU General Public License v3.0
53 stars 44 forks source link

Enabling SSH as a part of rbuild #60

Closed ManavAChauhan closed 1 month ago

ManavAChauhan commented 1 month ago

Hi,

I want to enable ssh by default in rock-3c. As There is no first boot config file available on rbuild repo.Please provide me steps to enable SSH.

RadxaYuntian commented 1 month ago

Since our systems are supplied with known default account and password, SSH is disabled by default to reduce the likelihood of being used as an attack vector. The exception is that if there is no display device connected during first boot, system will assume you can only access it via the network, and will enable SSH for you. Subsequent boot will not change the SSH service status.

ManavAChauhan commented 1 month ago

Hi,

I am building bullseye cli image in that i tried to take an SSH but not working.

On Tue, 18 Jun 2024, 4:57 pm ZHANG Yuntian, @.***> wrote:

Since our systems are supplied with known default account and password, SSH is disabled by default to reduce the likelihood of being used as an attack vector. The exception is that if there is no display device connected during first boot, system will assume you can only access it via the network, and will enable SSH https://github.com/radxa-pkg/rsetup/blob/main/config/before.txt#L76 for you. Subsequent boot will not change the SSH service status.

— Reply to this email directly, view it on GitHub https://github.com/radxa-repo/rbuild/issues/60#issuecomment-2175867535, or unsubscribe https://github.com/notifications/unsubscribe-auth/A47YKUTMGHBBZVJXKLY6IITZIAKRDAVCNFSM6AAAAABJPTQJE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZVHA3DONJTGU . You are receiving this because you authored the thread.Message ID: @.***>

RadxaYuntian commented 1 month ago

You could edit the final step of the image generation, and modify /config/before.txt to comment out commands that disable ssh.

ManavAChauhan commented 1 month ago

Ok, I don't want to modify before.txt. I want to enable SSH during build only. does it work if I add command to enable SSH in final stage??

On Wed, 19 Jun 2024, 7:30 am ZHANG Yuntian, @.***> wrote:

You could edit the final step https://github.com/radxa-repo/rbuild/blob/main/common/image.yaml#L302 of the image generation, and modify /config/before.txt to comment out commands that disable ssh https://github.com/radxa-pkg/rsetup/blob/main/config/before.txt#L44-L45.

— Reply to this email directly, view it on GitHub https://github.com/radxa-repo/rbuild/issues/60#issuecomment-2177378688, or unsubscribe https://github.com/notifications/unsubscribe-auth/A47YKUQWH43R7ADIG47J4N3ZIDQ3BAVCNFSM6AAAAABJPTQJE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZXGM3TQNRYHA . You are receiving this because you authored the thread.Message ID: @.***>

--

This message contains confidential information and is for the intended recipients. If you are not intended recipients_ you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.  The sender or VOLANSYS (www.volansys.com http://www.volansys.com/)

therefore does not accept liability for any errors or omissions in the contents of this message.___

RadxaYuntian commented 1 month ago

You HAVE to modify it, since that's where it was disabled. That script is ran at the first boot so whatever change you made during image building stage won't stick.

Generally systemd will enable all services on first boot, which is why that script has to be ran during boot for the similar reason as above:

When the machine is booted for the first time, systemd(1) will enable/disable all units according to preset policy, similarly to systemctl preset-all.