[LINUX] Just a note

List of commands used on CentOS 7

I will leave it as a memorandum for myself, but I will exchange it with some explanation. The commands used will be described more and more, so I will update them from time to time.

Data download and upload by scp command

This is a file transfer command between remote hosts that can ssh.

The first is to upload the file remotely to the server to which you are connecting to ssh. If you have an ssh connection, please disconnect.

# scp xxx.txt root@<ip address>:/tmp
//of the root user/xxx in the tmp directory.Upload txt

Next is how to download the file from the ssh connection.

# scp root@<ip address>: /tmp/xxx.txt /Users/Admin/Desktop
//xxx in the tmp directory.Put the txt file on the desktop(Mac)

Fixed IP address or change DHCP settings

I edited the file because I wanted to fix the IP address of CentOS on ESXi.

# ls /etc/sysconfig/network-scripts/
ifcfg-ens160     ifdown-eth   ifdown-routes  ifup-aliases  ifup-plip    ifup-tunnel
ifcfg-lo         ifdown-ippp  ifdown-sit     ifup-bnep     ifup-plusb   ifup-wireless
ifdown           ifdown-ipv6  ifdown-tunnel  ifup-eth      ifup-post    init.ipv6-global
ifdown-Team      ifdown-isdn  ifup           ifup-ippp     ifup-ppp     network-functions
ifdown-TeamPort  ifdown-post  ifup-Team      ifup-ipv6     ifup-routes  network-functions-ipv6
ifdown-bnep      ifdown-ppp   ifup-TeamPort  ifup-isdn     ifup-sit

#vim /etc/sysconfig/network-scripts/ifcfg-ens16
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static" #dhcp->static //Change
IPADDR=192.168.1.96 #add //add to
NETMASK=255.255.255.0 #add //add to
GATEWAY=192.168.1.1 #add //add to
DNS1=192.168.1.1 #add //add to
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens160"
UUID="53806499-7069-49cb-a15c-fd7e9eb89809"
DEVICE="ens160"
ONBOOT="yes"
#service network restart
//Restart service

Added new port to SELinux

#semanage port --add --type ssh_port_t --proto tcp xxx
// ssh_port_Added port xxx to t type(Protocol is tcp)

Recommended Posts

Just a note
A note about __call__
A note about subprocess
A note about mprotect (2)
Note
A note about KornShell (ksh)
Note
A note about TensorFlow Introduction
A small note following printf
A note about [python] __debug__
Python: A Note About Classes 1 "Abstract"
A note when gcloud is broken
A note about get_scorer in sklearn
A small sample note of list_head
A note for writing Python-like code
A note that prints numpy.array nicely
A note about mock (Python mock library)
Django note 4
A note where a Python beginner got stuck
GroupBy Note
argparse note
Django Note 5
Note: Python
Ansible Note
[Just a note] Until Keras + TensorFlow works on Mac OS X Sierra
Python note
A note on enabling PostgreSQL with Django
Django Note 1
direnv note
Django note 3
Django note 2
[Note] RepresenterError
A note about doing the Pyramid tutorial
I just want to add scipy, but it's a messy note. Ubuntu, Python 3.
A script that just gets an RSS feed
A note on customizing the dict list class
[Note] Create a one-line timezone class with python
Enable Django https in just a few lines
A note on optimizing blackbox functions in Python
A note about the python version of python virtualenv
A simple Pub / Sub program note in Python
Python Note: When assigning a value to a string
[Note] How to create a Ruby development environment
A note about checking modifiers with Max Plus
[Note] How to create a Mac development environment