Skip to content

Commit 3deb99a

Browse files
authored
Update sonar-install-v6.txt
1 parent 041a956 commit 3deb99a

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

soarQube-Installation/sonar-install-v6.txt

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,31 @@
11
#!/bin/bash
22
# Author: Landmark Technology
33
# CentOs or REHEL 7/8
4-
# Install JAVA pre-requisite
4+
5+
#As a good security practice, SonarQuber Server is not advised to run sonar service as a root user,
6+
#so create a new user called sonar and grant sudo access to manage sonar services as follows
7+
# 1. create a sonar
8+
sudo useradd sonar
9+
# 2. Grand sudo access to sonar user
10+
sudo echo "sonar ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/sonar
11+
sudo chown -R sonar:sonar /opt/sonarqube/
12+
sudo chmod -R 775 /opt/sonarqube/
513
hostname sonar
14+
sudo su - sonar
15+
## 3. Enable PasswordAuthentication
16+
sudo sed -i "/^[^#]*PasswordAuthentication[[:space:]]no/c\PasswordAuthentication yes" /etc/ssh/sshd_config
17+
sudo service sshd restart
18+
19+
# 4. Install JAVA pre-requisite
620
cd /opt
721
sudo yum -y install unzip wget git
822
sudo wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm
923
sudo yum install jdk-8u131-linux-x64.rpm -y
10-
#Download the SonarqQube Server software.
24+
# 5. Download the SonarqQube Server software.
1125
sudo wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-7.8.zip
1226
sudo unzip sonarqube-7.8.zip
1327
sudo rm -rf sonarqube-7.8.zip
1428
sudo mv sonarqube-7.8 sonarqube
15-
<<add
16-
#As a good security practice, SonarQuber Server is not advised to run sonar service as a root user,
17-
so create a new user called sonar and grant sudo access to manage sonar services as follows
18-
add
19-
20-
sudo useradd sonar
21-
22-
# Grand sudo access to sonar user
23-
sudo echo "sonar ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/sonar
24-
sudo chown -R sonar:sonar /opt/sonarqube/
25-
sudo chmod -R 775 /opt/sonarqube/
26-
27-
## Enable PasswordAuthentication
28-
29-
sudo sed -i "/^[^#]*PasswordAuthentication[[:space:]]no/c\PasswordAuthentication yes" /etc/ssh/sshd_config
30-
sudo service sshd restart
3129

3230
# start sonarqube as sonar user using relative path
3331
sudo su - sonar

0 commit comments

Comments
 (0)