CentOS 7에서 계정에 Root 권한 부여하기

2019/07/08 19:56
계정 추가 : adduser
계정 수정 : usermod
계정 삭제 : userdel
1. sudo 권한 부여
vi /etc/sudoers
root    ALL=(ALL)    ALL 아래에 다음 내용 추가
계정명    ALL=(ALL)    ALL
2. root 그룹 부여
vi /etc/group
root:x:0: ----> root:x:0:계정명
3. uid, gid 값을 root 값으로 변경
vi /etc/passwd
계정명:x:uid:gid::/home/계정명:/bin/bash --------> 계정명:x:0:0::/home/계정명:/bin/bash
4. SSH Config 수정
vi /etc/ssh/sshd_config
PermitRootLogin = prohibit-password | without-password | no 일 경우,
PermitRootLogin yes 로 변경
5. Service 재 시작
service sshd restart



CentOS 7.4에서 PostgreSQL 9.6 설치

2019/07/08 11:45
1. PostgreSQL Installation by using yum
yum install -y postgresql9.6*
2. Initialize Database
/usr/pgsql-9.6/bin/postgresql96-setup initdb
3. Service Registry on System Boot
systemctl start postgresql-9.6
systemctl enable postgresql-9.6
4. Edit Configurations
vi /var/lib/pgsql/9.6/data/pg_hba.conf
    host    all             all              127.0.0.1/0               md5
    host    all             user                       0.0.0.0/0                  md5
vi /var/lib/pgsql/9.6/data/postgresql.conf
   listen_address = '*'
5. Service Restart
systemctl restart postgresql-9.6

CentOS 7.4 SFTP 설정

2019/06/17 20:37
1. sftp user creation
  • create the user
sudo adduser access
  • assign a password to the new user
sudo passwd access

2. Create Directory for File Transfer
  • create the directory for file upload
sudo mkdir -p /var/sftp/uploads
  • establish the root user as owner
sudo chown root:root /var/sftp
  • grant write permissions to the root user and read to the other users
sudo chmod 755 /var/sftp
  • modify the owner of uploads to be the user access
sudo chown access:access /var/sftp/uploads

3. Restrict Directory Access
  • restrict the access by the terminal to the user access
sudo vi /etc/ssh/sshd_config
  • In the final part of the file, add followings
Match User access

ForceCommand internal-sftp
PasswordAuthentication yes
ChrootDirectory /var/sftp
PermitTunnel no
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no
  • Save the changes using the key combination
ESC + :wq
  • apply the changes in SSH
sudo systemctl restart sshd

4. Verify SSH Connection
  • SSH connection
ssh acces@{server_ip}
         ==> The result is verified that the connection will be closed through SSH
  • Use the sftp protocol
sftp access@{server_ip}










CentOS 7.4 에서 Nexus 설치

2019/06/17 13:19
<기본 환경>
CentOS 7.4.1708

<Base Command>
OS Terminate : systemctl power-off (--force)
OS Reboot : systemctl reboot (--force)
<Network Configuration>
Ethernet Card 확인 : nmcli d

<DHCP 설정>
nmtui
service network restart
ip addr
yum check-update
yum update

<Pre-requirements>
Nexus : 3.16.2-01 Version
Java : OpenJDK 1.8

<Installation of Nexus>
1. Java 버전 확인
java -version
설치되어 있지 않을 경우,
yum -y install java-1.8*
2. OS 방화벽 설정
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
systemctl reload firewalld (or firewall-cmd --reload)
만약 작업 도중, firewall-cmd 명령어가 실패하면 firewalld 서비스 설치 필요
yum -y install firewalld
systemctl unmask firewalld
systemctl enable firewalld
systemctl start firewalld
3. Nexus Default Port 방화벽 설정
firewall-cmd --permanent --add-port=8081/tcp
firewall-cmd --reload
만약, ERROR: Exception DBusException: org.freedesktop.DBus.Error.AccessDenied 오류가 발생하면,
yum -y install system-config-firewall
system-config-firewall-tui --> Firewall Enabled Check
systemctl start firewalld
systemctl status -l firewalld
이후 방화벽 설정 작업 다시 시도.
그래도 실패하면, 시스템 재시동 (reboot) 이후 작업하면 정상 동작함.

4. Nexus Download
wget --no-check-certificate https://download.sonatype.com/nexus/3/latest-unix.tar.gz
mv latest-unix.tar.gz nexus-3.tar.gz
wget이 정상 동작하지 않을 경우,
yum -y install wget
5. Nexus Extraction and Installation
mkdir /opt/nexus_dir
mv nexus-3.tar.gz /opt/nexus_dir
cd /opt/nexus_dir
tar zxvf nexus-3.tar.gz
6. Nexus Start
cd /opt
chmod -R 777 nexus_dir
/opt/nexus_dir/nexus-3.16.2-01/bin/nexus run
7. References
https://help.sonatype.com/repomanager3/installation
https://help.sonatype.com/learning/repository-manager-3/first-time-installation-and-setup
https://conory.com/blog/42523

CentOS 7.4에서 gitlab 제거

2019/06/14 15:47
설치되어 있는 gitlab을 제거하기 위해서는 다음과 같은 순서로 실행한다.
gitlab-ctl cleanse
gitlab-ctl uninstall
yum remove gitlab-ce