It will automatically hide system users (UID < 1000)
To hide ordinary users from the login list create or edit a file named after the user to hide in /var/lib/AccountsService/users/
to contain at least:
/var/lib/AccountService/users/username
[User]
SystemAccount=true
Hide user from login list
pipe viewer
Fedora / archive url
http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/
Fedora / fail2ban - sshd
fail2ban 설치
# dnf install fail2ban
설정하기
# /etc/fail2ban/jail.d/custom.conf [DEFAULT] bantime = 600 banaction = firewallcmd-ipset backend = systemd ignoreip = 127.0.0.1 # 여러개 등록시 공백으로 구분 findtime = 600 maxretry = 3 [sshd] enabled = true
fail2ban 활성화 및 시작
# systemctl enable fail2ban.service
# systemctl start fail2ban.service
fail2ban 상태 확인
# fail2ban-client status sshd
참고사이트
fail2ban.org
https://www.fail2ban.org
landoflinux.com
http://landoflinux.com/linux_fail2ban_install_configuration.html
Fedora 20 / Masquerading
DHCPD 설치 및 설정
yum install dhcp
/etc/dhcp/dhcp.conf
ddns-update-style interim; ignore client-updates; subnet 192.168.10.0 netmask 255.255.255.0 { # --- default gateway option routers 192.168.10.1; option subnet-mask 255.255.255.0; option domain-name-servers 168.126.63.1, 168.126.63.2; option time-offset -18000; # Eastern Standard Time range dynamic-bootp 192.168.10.2 192.168.10.254; default-lease-time 21600; max-lease-time 43200; }
systemctl
systemctl enable dhcpd.service
systemctl start dhcpd.service
firewall-cmd
firewall-cmd --zone=external --add-masquerade
firewall-cmd --zone=external --add-masquerade --permanent
firewall-cmd
포트 열기
firewall-cmd --zone=public --add-port=8882/tcp --permanent
포트 닫기
firewall-cmd --zone=public --remove-port=8882/tcp --permanent
fedora / 컴파일한 apache2 서비스 등록
# apache2가 설치된 경로의 bin/apachectl 을 /etc/init.d/에 apache2라는 이름으로 복사한다.
cp /usr/local/apache2/bin/apachectl /etc/init.d/apache2
# 복사한 apache2 파일을 편집한다.
vim /etc/init.d/apache2
# 아래 내용들을 #!/bin/sh 라인 바로 아래에 복사한다.
#
# chkconfig: 2345 90 90
# description: Apache HTTP Server
# processname: apache2
# config: /usr/local/apache2/conf/httpd.conf
# pidfile: /var/run/apache2.pid
# chkconfig 명령으로 등록
chkconfig --add apache2
Fedora / GUI 설치 using yum
『GNOME 설치』
# yum groupinstall "GNOME Desktop Environment"
『GNOME 설치』
# yum groupinstall "KDE (K Desktop Environment)"
『패키지 그룹 확인』
# yum grouplist
참고)
1) # 은 쉘 프롬프트 입니다.
2) root 권한에서 수행합니다.
Fedora / Time Zone 변경하기
# cp /usr/share/zoneinfo/Asia/Seoul /etc/localtime
# date
2012. 01. 02. (월) 12:48:05 KST
man strcpy - No manual entry for strcpy ? in fedora
페도라 설치 후 man strcpy 했더니 없다네..
무슨 패키지가 설치되지 않았을까?
위 패키지 man-pages 와 man-pages-ko 를 yum 을 이용하여 설치하면 끝~
이때는 /etc/security/limits.conf 파일을 조정하여 하나의 프로세스가 최대 열 수 있는 파일 개수를 늘려주면 해결된다. (조정하지 않으면 Fedora 9에서 1024개임)
아래는 Fedora 9의 /etc/security/limits.conf 파일을 내용을 보여준다.
주석을 읽어보면 설정하는 방법이 자세히 나온다.
#
#Each line describes a limit for a user in the form:
#
#<domain> <type> <item> <value>
#
#Where:
#<domain> can be:
# - an user name
# - a group name, with @group syntax
# - the wildcard *, for default entry
# - the wildcard %, can be also used with %group syntax,
# for maxlogin limit
#
#<type> can have the two values:
# - "soft" for enforcing the soft limits
# - "hard" for enforcing hard limits
#
#<item> can be one of the following:
# - core - limits the core file size (KB)
# - data - max data size (KB)
# - fsize - maximum filesize (KB)
# - memlock - max locked-in-memory address space (KB)
# - nofile - max number of open files
# - rss - max resident set size (KB)
# - stack - max stack size (KB)
# - cpu - max CPU time (MIN)
# - nproc - max number of processes
# - as - address space limit (KB)
# - maxlogins - max number of logins for this user
# - maxsyslogins - max number of logins on the system
# - priority - the priority to run user process with
# - locks - max number of file locks the user can hold
# - sigpending - max number of pending signals
# - msgqueue - max memory used by POSIX message queues (bytes)
# - nice - max nice priority allowed to raise to values: [-20, 19]
# - rtprio - max realtime priority
#
#<domain> <type> <item> <value>
#
#* soft core 0
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#@student - maxlogins 4
#
wittgens soft nofile 8192
wittgens hard nofile 8192
root soft nofile 8192
root hard nofile 8192
# End of file
로그인을 다시하여 ulimit -a 명령을 사용하여 변경된 내용을 확인할 수 있다.
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 16255
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 8192
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 1024
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
특정 프로세스가 열고 있는 파일을 알고 싶으면 아래 명령으로 확인 가능하다
Fedora Core yum 저장소
다행히도 아래에 저장되어 있으니, 현재 core를 사용중이라면 /etc/yum.repo.d/ 안의 저장소 주소를 아래의 것으로 변경해서 사용하면 될 듯..

http://archives.fedoraproject.org/pub/archive/fedora/linux/
Fedora / Masquerading 설정하기
* eth0 - 외부 네트워크
* eth1 - 내부 네트워크
* eth1에 연결된 컴퓨터가 eth0를 통해 외부 네트워크로 접근하려고 한다.
1. dhcp 설치 : 만약 eth1에 연결된 컴퓨터들이 IP 자동할당을 원하면 아래 패키지를 설치해주고, 설정해줘야 한다.
1) dhcp 데몬 패키지 설치
2) dhcp 데몬 설정 ( /etc/dhcpd.conf )
eth1에 연결될 컴퓨터의 네트워크 192.168.1. 임
ddns-update-style interim; ignore client-updates; subnet 192.168.1.0 netmask 255.255.255.0 { # --- default gateway option routers 192.168.1.1; option subnet-mask 255.255.255.0; option domain-name-servers 168.126.63.1, 168.126.63.2; option time-offset -18000; # Eastern Standard Time range dynamic-bootp 192.168.1.2 192.168.1.254; default-lease-time 21600; max-lease-time 43200; }
3) dhcp 데몬 구동
2. /etc/sysctl.conf 파일 수정
3. /proc/sys/net/ipv4/ip_forward 파일을 변경함
4. iptables 기존 규칙 삭제 (아래 명령들은 프롬프트 상태에서 입력한다.)
iptables -F OUTPUT
iptables -F FORWARD
iptables -t nat -F
5. iptables 에 새 규칙 추가 (아래 명령들은 프롬프트 상태에서 입력한다.)
iptables -P OUTPUT ACCEPT
iptables -P FORWARD DROP
iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
iptables -A FORWARD -j LOG
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
6. iptables 변경사항 저장 (아래 명령은 프롬프트 상태에서 입력한다.)
7. /etc/sysconfig/network-scripts/ifcfg-eth1 파일 수정
DEVICE=eth1 USERCTL=yes BOOTPROTO=none BROADCAST=192.168.1.255 IPADDR=192.168.1.1 NETMASK=255.255.255.0 NETWORK=192.168.1.0 ONBOOT=yes TYPE=Ethernet
Fedora / Fedora 7을 Fedora 8로 업그레이드 하기
아래 1~5번은 root 권한으로 셸(shell)에서 수행해야 합니다.
1. yum update
2. yum clean all
현재 패키지가 최신패키지가 되도록 1번과 2번 과정을 반복해 줍니다.
3. 아래 명령을 수행하여 rpm 을 설치합니다.
rpm -Uvh http://download.fedora.redhat.com/pub/fedora/linux/releases/8/Everything/i386/os/Packages/fedora-release-8-3.noarch.rpm http://download.fedora.redhat.com/pub/fedora/linux/releases/8/Everything/i386/os/Packages/fedora-release-notes-8.0.0-3.noarch.rpm위와 같이 해주면 /etc/fedora-release 파일 내용이 Fedora release 8 (Werewolf) 로 변경되어 있을 것입니다.
따라서, yum 업데이트시 fedora 8의 저장소로부터 업데이트가 진행될 수가 있습니다.
4. yum -y update
설치된 패키지가 fedora 8 로 업데이트 될 것이다. 참고로 -y 옵션은 질문에 대해 모두 yes로 응답합니다.
5. reboot
재부팅을 하여 Fedora 8으로 업데이트 되었는지 확인합니다.
-
?
Tip) /etc/yum.repos.d/*.repo 파일들을 편집하여 mirror url은 주석처리하고, base url을 이용하면, 다운로드 속도가 더 좋은 것 같았습니다.
Fedora / Fedora Core 6을 Fedora 7로 업그레이드 하기
1. yum update
2. yum clean all
현재 패키지가 최신패키지가 되도록 1번과 2번 과정을 반복해 줍니다.
3. 아래 명령을 수행하여 rpm 을 설치합니다.
rpm -Uhv http://download.fedora.redhat.com/pub/fedora/linux/releases/7/Fedora/i386/os/Fedora/fedora-release-7-3.noarch.rpm http://download.fedora.redhat.com/pub/fedora/linux/releases/7/Fedora/i386/os/Fedora/fedora-release-notes-7.0.0-1.noarch.rpm위와 같이 해주면 /etc/fedora-release 파일 내용이 Fedora release 7 (Moonshine) 로 변경되어 있을 것입니다.
따라서, yum 업데이트시 fedora 7의 저장소로부터 업데이트가 진행될 수가 있습니다.
4. yum -y update
설치된 패키지가 fedora 7 로 업데이트 될 것이다. 참고로 -y 옵션은 질문에 대해 모두 yes로 응답합니다.
5. reboot
재부팅을 하여 Fedora 7으로 업데이트 되었는지 확인합니다.
-
?
업데이트시 Missing Dependency: python(abi) = 2.4 is needed by package authconfig 에러가 발생되면,
yum remove authconfig 명령을 내려 authconfig를 제거한 후 다시 yum -y update를 하면 됨.
Fedora / hostname 변경하기
HOSTNAME="변경할 호스트명"
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=fot
[wittgens@fot ~]$
[wittgens@fot ~]$ hostname
fot