Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Wednesday, December 2, 2020

Linux - Initial setting after Linux install

■ Register a user on the following file.
njoonk  ALL=(ALL)  ALL
$ cat /etc/sudoers
njoonk ALL=(ALL) ALL

@ Disallowing Root Access
■ Edit the following file, set the PeritRootLogin parameter to no
PermitRootLogin no
$ vim /etc/ssh/sshd_config
PermitRootLogin no
sshd should be restared on CentOs8.2
$ systemctl restart sshd
$ systemctl status sshd

■ Change a host name
@ Before
[root@localhost home]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain
@ After
[root@localhost home]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=centos04
GATEWAY=192.168.11.1
Check hostname information
[root@localhost home]# hostnamectl
■ Edit hosts file
@ Before
[root@localhost home]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
@ After
[root@localhost home]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 centos04
192.168.11.23 centos04 localhost
■ Just restart the network
$ /etc/init.d/network restart

@ Set DNS
@ Before
[root@centos04 sysconfig]# cat /etc/resolv.conf
search centos04
@ After
[root@centos04 sysconfig]# cat /etc/resolv.conf
search centos04
nameserver 192.168.11.1

Tuesday, December 1, 2020

Linux - Changing a DHCP for STATIC IP on CentOs8.2

■ Changing a DHCP for STATIC IP.

1, Add the static IP information as below


2, Edit or add nameserver 192.168.0.1 into /etc/resolv.conf

3, Restart network (Don't execute the following command on remote)
    $ sudo nmcli networking off
    $ sudo nmcli networking on

OR
    $ sudo systemctl restart NetworkManager.service

4, Check the logs
    $ sudo journalctl -fu NetworkManager

Monday, November 30, 2020

MYSQL - How to install MYSQL8 on Ubuntu

■ How to install MYSQL8 on Ubuntu

1, Download repository package of MYSQL.

2, Install the Repository package of MYSQL.
    $ sudo dpkg -i mysql-apt-config_0.8.16-1_all.deb

3, Select Mysql Server & Cluster (Currently selected: mysql-8.0)

4, Select Mysql-8.0

5, Update the information of the package and install mysql8
    $ sudo apt install mysql-server


Thursday, January 19, 2017

Troubleshooting - it doesn't work after Installing Virtualbox in Mint 18.1 Linux

Have to make the following file.
sudo touch /etc/libuser.conf

Wednesday, September 28, 2016

Iptables - Mapping port directly (http or https)

■ Add the following rules.
For mapping a port from 80(HTTP) to 8080 and from 443(HTTPS) to 8443
*nat
-A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080
-A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 8443
COMMIT
You don't need to set up Apache HTTP for HTTP or HTTPS
But it will not work as it is, in addition, you have to do the next step

■ Have to open 8080 and 8443 port as below
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8443 -j ACCEPT

■ This is full set up in iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
#-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
#-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8443 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
*nat
-A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080
-A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 8443
COMMIT

Wednesday, August 26, 2015

wget - How to install on Mac

■ the wget is not installed on Mac.
■ 1.15 higher version wasn't installed on Mac.
$ cd /usr/local/src
$ sudo curl -O http://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz
$ sudo tar xvf ./wget-1.15.tar.gz
$ sudo ./configure --with-ssl=openssl
$ make && make install

Monday, April 27, 2015

Linux - You may get the following warning message when you login in Linux.


PC-4096:~ A11260$ ssh userId@172.xxx.xxx.1
Last login: Wed Apr 22 05:12:38 2015 from 172.17.90.xx
-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory

■ The following check box should be not checked.
 @ A selected data might be garbled in your Mysql.

Wednesday, March 4, 2015

Linux - How to change DHCP for STATIC - 3

@ This is a DHCP set automatically when it is installed.


@ This is a static IP address changed.

Tuesday, June 3, 2014

Linux - setting iptables on ubuntu

@https://www.digitalocean.com/community/articles/how-to-set-up-a-firewall-using-ip-tables-on-ubuntu-12-04

$ iptables -A INPUT -p tcp --dport ssh -j ACCEPT
$ iptables -A INPUT -p tcp --dport 80 -j ACCEPT
$ apt-get install iptables-persistent
@yes, yes
$ service iptables-persistent start

Saturday, May 31, 2014

Linux - yum

@ If you want to delete a package, do like this.
$ yum remove [package name lik git]

Saturday, May 24, 2014

Linux - how to open a port in Linux

@ Edit the iptables file
$ vim /etc/sysconfig/iptables
@ Add the following line.
------------------------------------------------------------------
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8081 -j ACCEPT
------------------------------------------------------------------

@ And then, just restart.
$ /etc/init.d/iptables restart

Linux - How to disable Root SSH Login on Linux - 2

@ Prohibit root user from loginning in remote.

@ 1.Exclude the comment "#" and then
@    You need to check the "no"
$ vi /etc/ssh/sshd_config
#----------------------------------------
PermitRootLogin no
#----------------------------------------

@ 2. You’ll need to restart the sshd service.
$ /etc/init.d/sshd restart

Sunday, May 11, 2014

Install - VirtualBox on Ubuntu 14.04 LTS

@ Down load contrib
$ sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" >> /etc/apt/sources.list'

@ Down load oracle_vbox
$ wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -

@ Update library
$ sudo apt-get update

@  Install virtualbox
$ sudo apt-get install virtualbox

Saturday, May 10, 2014

Link - Commands in Linux

@ Add users and groups
http://b2ctran.wordpress.com/2011/10/04/centos-user-and-user-group/

Link - OpenStack

@ The other way to install OpenStack
http://www.cloudbase.it/rdo-multi-node/

@ Information for network
http://solatech.tistory.com/263

OpenStack - Install

I succeeded in installation OpenStack on Sentos6.5,
But I want to stop or restart service.
I don't know that yet.

@ First, you need to install git to get the Devstack Scripts
$ yum install git
@ Make the sudo group
$ /usr/sbin/groupadd sudo

@ Add stack user and grant stack NOPASSWD
$ useradd -U -G sudo -s /bin/bash -m stack
$ echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
@ Input your password you like(openstack)
$ passwd stack

@ Change user and move the home.
$ su - stack
$ cd /home/stack
$ git clone git://github.com/openstack-dev/devstack.git

@ Create the localrc file
$ vim /home/stack/devstack/localrc
----------------------------------------------------------
#####################
# Date : 2013.03.20 #
# Name : naleeJang #
#####################
# Devstack localrc for Quantum all in one
# default
HOST_IP=19X.16X.11.9

# network
FLAT_INTERFACE=eth0
FIXED_RANGE=10.0.0.0/20
NETWORK_GATEWAY=10.0.0.1
FLOATING_RANGE=19X.16X.11.1/24
EXT_GW_IP=19X.16X.11.1

# vnc
VNCSERVER_LISTEN=0.0.0.0
VNCSERVER_PROXYCLIENT_ADDRESS=$HOST_IP

# logs
DEST=/opt/stack
LOGFILE=$DEST/logs/stack.sh.log
SCREEN_LOGDIR=$DEST/logs/screen

# system password
ADMIN_PASSWORD=openstack
MYSQL_PASSWORD=openstack
RABBIT_PASSWORD=openstack
SERVICE_PASSWORD=openstack
SERVICE_TOKEN=openstackservicetoken

# cinder
VOLUME_GROUP="cinder-volume"
VOLUME_NAME_PREFIX="volume-"

# install service
disable_service n-net
enable_service q-svc q-agt q-dhcp q-l3 q-meta quantum 
---------------------------------------------------------

@ Just execute
$ ./stack.sh

--------------------------------------------------------
@ Result Log
Horizon is now available at http://19X.16X.11.9/
Keystone is serving at http://19X.16X.11.9:5000/v2.0/
Examples on using novaclient command line is in exercise.sh
The default users are: admin and demo
The password: openstack
This is your host ip: 19X.16X.11.9

@ Thank you for information
http://naleejang.tistory.com/68

Friday, May 2, 2014

Linux - Update the kernel on CentOs

@ Update kernel on CentOs
$ yum update kernel kernel-devel kernel-headers

@ Just update
$ yum update

Link - Install Centos

@ Install  Centos
http://hyun2zzang.tistory.com/entry/VirtualBox-CentOS63x8664-%EC%84%A4%EC%B9%98

Monday, April 21, 2014

Install - VirtualBox on CentOs

#
#https://wiki.archlinux.org/index.php/Virtualbox#Failed_to_create_the_host-only_network_interface

@ If there is the error, install the following modules
$ yum install yum-plugin-priorities
$ yum groupinstall "Development Tools"
$ yum install kernel-devel

@Install VirtualBox-4.3 on CentOs
$ yum install VirtualBox-4.3

@Removing old VirtualBox kernel modules
@Recompiling VirtualBox kernel modules
$ service vboxdrv setup