Skip to content

Commit a7cddc2

Browse files
committed
Added openssh installation snippet
1 parent 5b98dff commit a7cddc2

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

index.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
await sleep(1000);
22
await $`clear`;
33
console.log(`Welcome to Linux Playbook repository. The aim of this repository is to provide a collection of scripts to quickly setup your Linux system for (mainly) development purpose.\n \n`);
4-
console.log(`We will install the following packages: \n - yarn \n - git \n - net-tools (to use ifconfig command) \n - ufw (uncomplicated firewalll) and enable port 80, 443 \n - nginx \n - docker \n - docker-compose \n`);
4+
console.log(`We will install the following packages: \n - yarn \n - git \n - net-tools (to use ifconfig command) \n - openssh (to allow ssh sessions from remote pc) \n - ufw (uncomplicated firewalll) and enable port 22, 80, 443 \n - nginx \n - docker \n - docker-compose \n`);
55
console.log(`You can choose 'y' for YES or 'n' for NO to decide about each installation.\n\n`);
66
await sleep(1000);
77
let shouldProceed = await question('Do you want to proceed? (y/n) ');

script.mjs

+16-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ if (shouldInstallNetTools.toLowerCase() === 'y') {
3131
console.log('Skipping net tools installation');
3232
}
3333

34+
//openssh-server
35+
await sleep(1000);
36+
let shouldInstallOpenSSH = await question('Do you want to install openssh-server? [y/n] ');
37+
if (shouldInstallOpenSSH.toLowerCase() === 'y') {
38+
console.log('Installing openssh-server');
39+
await $`sudo apt install openssh-server`
40+
await $`sudo systemctl enable ssh`
41+
await $`sudo systemctl start ssh`
42+
await $`sudo systemctl status ssh`
43+
} else {
44+
console.log('Skipping openssh-server installation');
45+
}
46+
3447
//ufw
3548
await sleep(1000);
3649
let shouldInstallUFW = await question('Do you want to install ufw? [y/n] ');
@@ -39,10 +52,12 @@ if (shouldInstallUFW.toLowerCase() === 'y') {
3952
await $`sudo apt install ufw`
4053
await $`sudo ufw allow 80/tcp`
4154
await $`sudo ufw allow 443/tcp`
55+
await $`sudo ufw allow 22/tcp`
4256
await $`sudo ufw enable`
57+
await $`sudo ufw start`
4358
await $`sudo ufw status`
4459
} else {
45-
console.log('Skipping ufw installation');
60+
console.log('Skipping ufw installation. Remote ssh to this computer may not work if you did not install openssh server');
4661
}
4762

4863
// nginx

setup-nvm.sh renamed to setup.sh

File renamed without changes.

0 commit comments

Comments
 (0)