[-문구-Compeople-문구-]

+::System::/Linux2022. 8. 22. 18:00

1. 하드디스크 추가, 리눅스 파티션 생성(fdisk)

* 전원 종료후. 디스크 추가 장착한 후. 시스템 부팅.

 

* 작업 전 파티션 확인

[root@localhost ~]# df -h
Filesystem           Size  Used Avail Use% Mounted on 
/dev/mapper/cl-root   46G  3.1G   43G   7% / 
devtmpfs             1.9G     0  1.9G   0% /dev 
tmpfs                1.9G     0  1.9G   0% /dev/shm 
tmpfs                1.9G  8.5M  1.9G   1% /run 
tmpfs                1.9G     0  1.9G   0% /sys/fs/cgroup 
/dev/sda1           1014M  184M  831M  19% /boot 
tmpfs                380M     0  380M   0% /run/user/0 
** 리눅스(CentOS)를 인스톨 할 때 mininum 기본값으로 설치하면, 대략 위와 같이 파티션이 형성됨

 

*파티션을 생성하기 위해서는 fdisk를 사용

[root@localhost ~]# fdisk -l

Disk /dev/sdb: 2199.0 GB, 2199023255552 bytes, 4294967296 sectors ==> 추가장착한 /dev/sdb,  2TB
Disk /dev/sda: 53.7 GB, 53687091200 bytes, 104857600 sectors => 기존 디스크 : /dev/sda

Device Boot      Start         End      Blocks   Id  System 
/dev/sda1   *        2048     2099199     1048576   83  Linux 
/dev/sda2         2099200   104857599    51379200   8e  Linux LVM 

 

*sdb 파티션 생성작업 시작
[root@localhost ~]# fdisk /dev/sdb

 

* 현재 디스크 상황 보여주기
Command (m for help): p

Disk /dev/sdb: 2199.0 GB, 2199023255552 bytes, 4294967296 sectors 
Units = sectors of 1 * 512 = 512 bytes 
Sector size (logical/physical): 512 bytes / 512 bytes 
I/O size (minimum/optimal): 512 bytes / 512 bytes 
Disk label type: dos 
Disk identifier: 0x88eb3dc1 

   Device Boot      Start         End      Blocks   Id  System 

 

* new의 약자. "n"을 눌러 디스크를 생성
Command (m for help): n
Partition type: 
   p   primary (0 primary, 0 extended, 4 free) 
   e   extended 

 

* 새롭게 추가한 디스크는 primary로 생성
Select (default p): p 


Partition number (1-4, default 1): 1 또는 Enter를 누르면 default 선택됨.
First sector (2048-4294967295, default 2048): 2048 또는 Enter를 누르면 default 선택됨.
Using default value 2048 
Last sector, +sectors or +size{K,M,G} (2048-4294967294, default 4294967294): 4294967294 또는 Enter를 누르면 default 선택됨
Using default value 4294967294 
Partition 1 of type Linux and of size 2 TiB is set 

 

* 디스크를 나누지 않고 전체를 사용하려면, 기본값으로 전부 엔터를 누르면 된다.
만약 나누려면 sector를 적당한 값으로 나누면 되고, 용량단위(MB)로 나눌 수도 있다.

* 작업완료 후 디스크 현황 다시 보기

Command (m for help): p

Disk /dev/sdb: 2199.0 GB, 2199023255552 bytes, 4294967296 sectors 
Units = sectors of 1 * 512 = 512 bytes 
Sector size (logical/physical): 512 bytes / 512 bytes 
I/O size (minimum/optimal): 512 bytes / 512 bytes 
Disk label type: dos 
Disk identifier: 0x88eb3dc1 

   Device Boot      Start         End      Blocks   Id  System 
/dev/sdb1            2048  4294967294  2147482623+  83  Linux 

** /dev/sdb1 이 새로 생성됨을 확인함.

 

* write의 약자. "w" 눌러서, 저장하고 fdisk를 빠져 나온다.
Command (m for help): w
 

2. 디스크 포맷, 마운트 하기

* ext4 파일시스템으로 포맷. ext4가 지원되지 않는 리눅스 시스템은 ext3로 포맷

[root@localhost ~]# mkfs.ext4 /dev/sdb1 

Allocating group tables: done 
Writing inode tables: done 
Creating journal (32768 blocks): done 
Writing superblocks and filesystem accounting information: 
done 

* 마운트 할 디렉토리 생성

[root@localhost ~]# mkdir /backup

 

* 생성한 디렉토리에 마운트

[root@localhost ~]# mount -t ext4 /dev/sdb1 /backup

 

* 마운트 확인

[root@localhost ~]# df -h 
Filesystem           Size  Used Avail Use% Mounted on 
/dev/mapper/cl-root   46G  3.1G   43G   7% / 
devtmpfs             1.9G     0  1.9G   0% /dev 
tmpfs                1.9G     0  1.9G   0% /dev/shm 
tmpfs                1.9G  8.5M  1.9G   1% /run 
tmpfs                1.9G     0  1.9G   0% /sys/fs/cgroup 
/dev/sda1           1014M  184M  831M  19% /boot 
tmpfs                380M     0  380M   0% /run/user/0 
/dev/sdb1            2.0T   81M  1.9T   1% /backup 

부팅 될 때 신규로 추가한 디스크를 fstab에 등록하는 방법은 2가지가 있다.

uuid로 마운트하는 방법, /dev 위치로 마운트 하는 방법

어떤 방법을 사용해도 상관은 없다.

/dev 위치로 마운트하는 것이 좀 더 편하지만, uuid로 마운트 진행.

[root@localhost ~]# ls -la /dev/disk/by-uuid/ 
total 0 
drwxr-xr-x 2 root root 120 Jun 29 23:25 . 
drwxr-xr-x 5 root root 100 Jun 29 22:46 .. 
lrwxrwxrwx 1 root root  10 Jun 29 22:46 0bdb72af-3279-4852-98e9-d73211f694 -> ../../dm-1 
lrwxrwxrwx 1 root root  10 Jun 29 23:25 47b5d817-f881-423d-b2f6-efa9ba3a8c -> ../../sdb1
lrwxrwxrwx 1 root root  10 Jun 29 22:46 4e90cbda-a275-4128-a703-7e28821a90 -> ../../dm-0 
lrwxrwxrwx 1 root root  10 Jun 29 22:46 7a00c89a-cd13-42ac-8f4b-011fd49520 -> ../../sda1 

* fastb 수정 

[root@localhost ~]# vi /etc/fstab
/dev/mapper/cl-root     /                       xfs     defaults        0 0 
UUID=7a00c89a-cd13-42ac-8f4b-09311fd49520 /boot                   xfs     defaults        0 0 

 

* uuid 값으로 마운트

UUID=47b817-f881-423d-b2f6-ef08a9ba3a8c  /backup                 ext4    defaults        1 0 

 

* /dev 위치로 마운트 한느 방법, 위 설정값과 중복이므로 주석처리 해둠. 둘중 선택해서 사용가능

#/dev/sdb1                                /backup                 ext4    defaults        1 0 
/dev/mapper/cl-swap     swap                    swap    defaults        0 0 

* fstab 마지막 숫자는 1 0 으로 설정한다. 마지막 숫자를 1로 하면 일정기간마다 fsck 체크를 하기 때문에, 디스크가 클 경우(1TB 이상)는 반드시 0으로 설정.

* 서버 리부팅해서 정상적으로 신규디스크가 마운트 되는 지 확인.

Posted by Compeople
+::System::/Linux2021. 12. 10. 14:38

보안 차원에서 ssh 서비스 기본 포트인 22번을 다른 포트로 변경 할 경우가 있다.

ssh 기본 포트 22 번을 사용할 경우 외부에서 불법 해킹 시도로 접속 시도가 많다.(물론 방화벽에서 제어 가능)
이럴때 기본 포트만 변경 만드로 이런 불법 시도를 차단 할 수 있다. 

1. 방화벽에 변경 할 포트 설정
예제는 "9022" 번으로 포트를 변경하려 한다. 옵션에 변경 할 포트를 써서 방화벽 정책으로 추가한다.
# firewall-cmd --permanent --zone=public --add-port=9022/tcp
# firewall-cmd --reload

2. ssh 환경 설정
기본 환경파일 /etc/ssh/sshd_config 파일을 수정한다. 기본 주석처리가 되어 있다. 수정 또는 추가 하여 설정한다.
# vi /etc/ssh/sshd_config
#Port 22
Port 9022

** 보안 추가 설정 **
ssh 로 root 접속을 차단하려면 아래 옵션을 활성화 한다.
  - 변경전 : #PermitRootLogin yes  <== 주석 해제 및 아래처럼 " no"로 수정
  - 변경후 : PermitRootLogin no

3. 서비스를 재구동
# systemctl restart sshd

*** 만약 오류가 난다면. ***
Job for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xe" for details.

** 중요 ** selinux 를 사용할 경우 포트 변경(* semanage 는 SELinux Policy Management tool)
# semanage port -a -t ssh_port_t -p tcp 9022

다시 서비스를 재구동
# systemctl restart sshd

** 혹시 그래도 오류가 해결되지 않는다면, 위 설정한 "/etc/ssh/sshd_config" 파일등을 다시 확인하여 오타나 오류가 없는지 다시 한번 확인한다.

Posted by Compeople
+::System::/Linux2021. 12. 10. 14:30

** 리눅스, CentOS 7 기준 네트워크 장치명 변경 방법

1. 디바이스 장치명 확인

네트워크 장치명 확인을 위해, "ifconfig -a" 명령어 실행.

명령어 실행해 보면 "eth0", "lo" 처럼 장치명이 보이고, 이 장치명을 변경 해 보자.

ifconfig -a

 

2. 커널 옵션 추가

# vi /etc/default/grub

GRUB_CMDLINE_LINUX 옵션 맨 뒤에

"net.ifnames=0 biosdevname=0" 커널 옵션 추가.

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto spectre_v2=retpoline rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet net.ifnames=0 biosdevname=0"
GRUB_DISABLE_RECOVERY="true"

vi /etc/default/grub

3. 부트로더 수정

# grub2-mkconfig -o /boot/grub2/grub.cfg

grub2-mkconfig -o /boot/grub2/grub.cfg

 

4. 디바이스 이름 변경

# cd /etc/sysconfig/network-scripts 이동하여, "ifcfg-0000" 원하는 장치명으로 변경

cd /etc/sysconfig/network-scripts

vi /etc/sysconfig/network-scripts/ifcfg-eth0

ifcfg-0000 해당 파일 내용중 NAME=ehh0 부분, 바꾸고 싶은 이름으로 수정

vi /etc/sysconfig/network-scripts/ifcfg-eth0

Posted by Compeople
+::System::/Linux2021. 7. 13. 08:57

리눅스 기반의 시스템에서 네트웍카드를 변경시키거나, 가상화 기반의 시스템을 복사해서 새롭게 서버를 운영하려고 할때 간혹, 기존 맥어드레스 정보가 새롭게 변경된 정보를 반영이 안되어 네트웍이 정상적으로 작동하지 않을때가 있다.

아래의 경우는 가상화 기반의 시스템을 새롭게 복사해서 새로운 가상화서버로 운영하려고 할때, 기존 네트웍카드의 맥어드레스정보가 새롭게 변경된 정보로 업데이트 되지 않을때의 경우입니다.

VMware 가상 머신을 복사해서 새롭게 가상 머신을 운영하려 하면 MacAddress가 변경됩니다.
가상머신에서 사용하는 네트웍카드의 경우, 가상의 MacAddress를 사용하기 때문에
새롭게 복사를 해서 운영하려는 가상머신은 새롭게 변경된 정보를 네트웍 정보에 반영 시켜 줘야 합니다.

이 상태에서 부팅해보면 네트워크가 정상 동작하지 않습니다. 

Mac Address를 변경하여 네트워크를 정상 동작하게 하는 방법은 다음과 같습니다.
CentOS 6.9 기준 설명입니다.

먼저 네트웍카드정보의 MacAddress 부분의 정보를 변경해 줍니다.
/etc/sysconfig/networking-scripts/ifcfg-eth0 파일을 편집기로 열어줍니다. 
HWADDR=00:50:56:39:FA:2A 부분을 새로운 Mac Address를 입력해줍니다.

[ /etc/sysconfig/networking-scripts/ifcfg-eth0 ]

 

그다음 최종 반영을 위해 
/etc/udev/rules.d/70-persistent-net.rules 파일을 삭제해서 새롭게 자동생성시켜주거나
해당 파일을 열어 MacAddress 부분만 변경해 주는 방법이 있습니다.

[ /etc/udev/rules.d/70-persistent-net.rules ]

삭제를 하고 재부팅하면 새로운 Mac Address에 맞게 이 스크립트가 새로 생성됩니다.

Posted by Compeople
+::System::/Linux2020. 1. 15. 12:57

리눅스를 콘솔모드로 사용하면 기본적 환경이 창이 작고, 색이 칙칙하다.

원하는 해상도를 설정하여 창도 크게, 색도 화사하게 변경이 가능하다.

 

변경 방법은 부트로더인 GRUB의 설정파일에 "vga=해상도코드" 를 추가시켜주면 된다.

설정파일은 /etc/grub.conf   /boot/grub/grub.conf   /boot/grub/menu.lst

위 세 파일중 하나만 골라 바꿔주면 된다.

세파일 모두 "/boot/grub/grub.conf" 로 링크 되어있기 때문에 모두 같은 파일이다.

 

grub.conf 파일을 수정 한다.

1024*768 / 16bit 로 설정할 경우, 791코드를 입력 해 주면 된다.

파일을 열고, kernel 이라고 시작하는 문장 맨 끝에 "vga=791" 이라고 추가시켜 준다.

 

vga 코드표는 아래와 같다.(참고=검토필요)

 

16진수로 넣을때는 앞에 0x 붙여준다.

변경 하였다면. 시스템 재부팅 해 본다.

VESA Display Mode 의 로딩화면이 나온다.

 

만약 위 표의 코드를 읽지 못한다면 아래와 같이 메세지가 출력된다.

엔터를 누르면, 비디오 모드의 코드값을 확인할수 있다.

위와 같이 지원되는 코드와 해상도가 나온다.

원하는 해상도의 앞에 적혀있는 코드값을 입력한다.

1024x768x16 을 할려면 333을 입력하면 된다.

위의 코드 리스트는 /etc/grub.conf 파일에서 vga=ask 로 설정해도 볼수 있다.

잘못된 코드를 입력하거나, vga=ask 로 설정하여 부팅 중간에 vga코드를 입력하였을때는

꼭!!! 부팅 후, /etc/grub.conf 의  vga=??? 값을 설정해 주여야 한다.

 

만약, 수정해서 재부팅 했는데.. 부팅 정상적으로 안된다면..

부팅시 위와 같은 화면이 뜰때 아무 키나 눌러준다.(Press any key to enter the menu)

e 키를 누룬다.

커서를 두번째 줄로 옮기고, e 키를 누른다.

grub.conf 에서 우리가 추가했던 내용이 나온다. 알맞게 수정해서 엔터키를 누른후,

b 키를 누르면 부팅이 된다...

Posted by Compeople
+::System::/Linux2019. 12. 24. 22:44

기본지식

 

IDE0 HDD : /dev/hda 로 인식됨,  디스크내의 파티션은 hda1 / hda2 / hda3 .....

IDE1 HDD : /dev/hdb 로 인식됨, 디스크내의 파티션은 hdb1 / hdb2 /hdb3....

 

하드디스크 추가하고 리눅스 부팅후...

 

1. fdisk -l 로 디스크가 추가된 것을 확인 할 수 있다.

 

[root@localhost ~]# fdisk -l

Disk /dev/hda: 20.0 GB, 20060651520 bytes
255 heads, 63 sectors/track, 2438 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14        2438    19478812+  8e  Linux LVM

Disk /dev/hdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1       19457   156288321    7  HPFS/NTFS      <- 추가된 hdd
[root@localhost ~]#

 

 

2. fdisk로 파티션 설정하기


[root@localhost ~]# fdisk /dev/hdb

The number of cylinders for this disk is set to 19457.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/hdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1       19457   156288321    7  HPFS/NTFS

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): d     <- 파티션 삭제
Selected partition 1

Command (m for help): p

Disk /dev/hdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n     <- 파티션 추가
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-19457, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-19457, default 19457):
Using default value 19457

Command (m for help): p

Disk /dev/hdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1       19457   156288321   83  Linux

 

Command (m for help): v
5165 unallocated sectors

Command (m for help): w  <- 저장하고 종료
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

 

3. 디스크 format : mkfs

 

[root@localhost home]# mkfs
Usage: mkfs [-V] [-t fstype] [fs-options] device [size]
[root@localhost ~]# mkfs.ext3 /dev/hdb1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
19546112 inodes, 39072080 blocks
1953604 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=41943040
1193 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 32 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@localhost ~]#

 

 

3. mount 하기

 

먼저 mount할 디렉토리를 만든다

mkdir /home/music

 

/dev/hdb1을 /home/music 에 마운트 한다.

mount /dev/hdb1 /home/music

 

4. /etc/fstab 내용 추가 ( 리부팅후에도 적용되도록)

 

#vi /etc/fstab

/dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /dev/shm                tmpfs   defaults        0 0
none                    /proc                   proc    defaults        0 0
none                    /sys                    sysfs   defaults        0 0
/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0
/dev/hdb1               /home/music             ext3    defaults        1 1    <- 추가된 내용



출처: https://rapperkw.tistory.com/129 [행운.]

Posted by Compeople
+::System::/Linux2018. 12. 11. 13:24

[ Centos Hostname 변경 ]


간혹 여러서버에 동시 접속 후 작업하다가 서버가 구분이 안되어 다른 서버에 작업을 한다던하 할때가 있다, 이때를 대비해서 서버별로 Hostname 을 다르게 설정 해 두면 조금더 안전한 작업이 가능 하다.

[root@localhost ~]#  기본설정이 이렇게 된 경우가 많다.

 

1. hostname 변경(재 시작시 원래 설정으로 돌아감)

# hostname 확인

[root@localhost ~]# hostname
localhost


# hostname 변경

[root@localhost ~]# hostname webserver


# 변경후 hostname 확인

[root@localhost ~]# hostname
webserver



2. hostname 영구 변경(재 시작시 설정 유지)

#CentOS 6

[root@localhost ~]# vi /etc/sysconfig/network

HOSTNAME=webserver


#CentOS 7

 [root@localhost ~]# hostnamectl set-hostname webserver


hostname 영구 변경 후 서버 재 시작(재 접속)

영구 변경을 한 후 서버 재시작 또는 ssh 재 접속 시 아래 와 같이 hostname 이 변경 된 값 확인 가능.

[root@webserver ~]#

Posted by Compeople
+::System::/Linux2017. 2. 17. 13:20

[ Linux ] 아파치 동시접속자수 확인Web Progreming 2011.12.26 00:08

* LISTEN 되는 모든 포트 : netstat -l 또는 netstat -nap | grep LISTEN
* 모든 서비스 동시 접속자 수 : netstat -nap | grep ESTABLISHED | wc -l
* 웹 동시 접속자 수 : netstat -nap | grep :80 | grep ESTABLISHED | wc -l
* 웹서버 커넥션수 체크 : netstat -n|grep -F :80|egrep '(ESTAB|SYN)'|awk '{print $5}'|sed 's/:[0-9]*//'|sort -u|wc -l

 

** 리눅스 watch명령어를 이용한 주기적 명령어 실행

watch -n 1 "netstat -n|grep -F :80|egrep '(ESTAB|SYN)'|awk '{print $5}'|sed 's/:[0-9]*//'|sort -u|wc -l"

watch 명령어로 1초 주기로 ""안에 있는 명령어를 실행

watch 명령어로 1초 주기로 웹서버 커넥션수 체크.

 

** 실행화면

[root@sclc ~]# watch -n 1 "netstat -n|grep -F :80|egrep '(ESTAB|SYN)'|awk '{print $5}'|sed 's/:[0-9]*//'|sort -u|wc -l"

Every 1.0s: netstat -n|grep -F :80|egrep '(ESTAB|SYN)'|awk '{print }'|sed 's/:[0-9]*...  Fri Feb 17 13:18:40 2017

51

Posted by Compeople
+::System::/Linux2016. 8. 18. 08:23

** 일단 급한대로.. 정리부터 해두고.

추후, 직접. 작업후 포스팅 예정..

 

** 출처글.. : 메튜 장 님 블로그...

Cent OS 6을 깔고, Database Mode에서 VSFTP를 설정하던 도중 위와 같은 에러가 났다.
인터넷을 아무리 뒤져봐도, # setsebool -P ftp_home_dir=1 라는 말 밖에 없다.
나같은 경우는 -P를 먹이면 명령어가 먹지도 않고..

그러던 중, 한번 getsebool 을 확인하던 도중

 

[root@fiamm ~]# getsebool -a | grep ftp
allow_ftpd_anon_write –> off
allow_ftpd_full_access –> off
allow_ftpd_use_cifs –> off
allow_ftpd_use_nfs –> off
ftp_home_dir –> on
ftpd_connect_db –> off
ftpd_use_fusefs –> off
ftpd_use_passive_mode –> off
httpd_enable_ftp_server –> off
tftp_anon_write –> off
tftp_use_cifs –> off
tftp_use_nfs –> off

 

위와 같은 부분을 발견했다. allow_ftpd_full_access ? 오 뭔가 모두 허용하는 것 같은 느낌..
그래서 다시

 

[root@fiamm ~]# setsebool allow_ftpd_full_access on

 

[root@fiamm ~]# service vsftpd restart

 

하니깐..
오 아주 잘된다. 좋다 좋아..

서버기반을 거의 10년만에 윈도 서버에서 리눅스로 옮기려니깐 에로사항이 좀 있는 것 같다.
그래도 재밌다 🙂 삽질은 항상 재밌는 법..

 

** 출처..

http://matthew.kr/centos-%EC%9D%98-vsftpd-%EC%A0%91%EC%86%8D%EC%8B%9C-500-oops-cannot-change-directoryroot-%EC%97%90%EB%9F%AC/

Posted by Compeople
+::System::/Linux2015. 10. 14. 21:06

[root@kfd1149 Install]# uname -a
Linux kfd1149.cafe24.com 2.6.32-431.17.1.el6.x86_64 #1 SMP Wed May 7 23:32:49 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
[root@kfd1149 Install]# cat /etc/redhat-release
CentOS release 6.5 (Final)

[root@kfd1149 Install]# yum -y install lrzsz
Loaded plugins: fastestmirror, security
Determining fastest mirrors
Excluding mirror: data.nicehosting.co.kr
 * base: centos.tt.co.kr
Excluding mirror: data.nicehosting.co.kr
 * extras: centos.tt.co.kr
 * rpmforge: ftp.neowiz.com
Excluding mirror: data.nicehosting.co.kr
 * updates: centos.tt.co.kr
base                                                                                | 3.7 kB     00:00    
extras                                                                              | 3.4 kB     00:00    
rpmforge                                                                            | 1.9 kB     00:00    
updates                                                                             | 3.4 kB     00:00    
updates/primary_db                                                                  | 1.9 MB     00:00    
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package lrzsz.x86_64 0:0.12.20-27.1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================
 Package               Arch                   Version                           Repository            Size
===========================================================================================================
Installing:
 lrzsz                 x86_64                 0.12.20-27.1.el6                  base                  71 k

Transaction Summary
===========================================================================================================
Install       1 Package(s)

Total download size: 71 k
Installed size: 159 k
Downloading Packages:
lrzsz-0.12.20-27.1.el6.x86_64.rpm                                                   |  71 kB     00:00    
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : lrzsz-0.12.20-27.1.el6.x86_64                                                           1/1
  Verifying  : lrzsz-0.12.20-27.1.el6.x86_64                                                           1/1

Installed:
  lrzsz.x86_64 0:0.12.20-27.1.el6                                                                         

Complete!
[root@kfd1149 Install]#

 

** 업데이트 에러발생시

[root@dev-linux08 119.iws.kr]# yum -y install lrzsz
Loaded plugins: fastestmirror, security
Setting up Install Process
Determining fastest mirrors
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Invalid release/repo/arch combination/
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base

* 최근 CentOS 6 버전 업데이트 지원이 종료되면서 yum update 등 명령어 사용 시 오류가 발생하고 있다.

* 해결 방법 : 각 OS Bit에 맞춰 3줄씩 명령어 입력 후 yum update 하면 정상 동작 완료 / 업데이트 사이트 주소 변경.


32Bit
echo "https://vault.centos.org/6.10/os/i386/" > /var/cache/yum/i386/6/base/mirrorlist.txt
echo "http://vault.centos.org/6.10/extras/i386/" > /var/cache/yum/i386/6/extras/mirrorlist.txt
echo "http://vault.centos.org/6.10/updates/i386/" > /var/cache/yum/i386/6/updates/mirrorlist.txt
64Bit
echo "https://vault.centos.org/6.10/os/x86_64/" > /var/cache/yum/x86_64/6/base/mirrorlist.txt
echo "http://vault.centos.org/6.10/extras/x86_64/" > /var/cache/yum/x86_64/6/extras/mirrorlist.txt
echo "http://vault.centos.org/6.10/updates/x86_64/" > /var/cache/yum/x86_64/6/updates/mirrorlist.txt

Posted by Compeople