[¿ìºÐÅõ] Çʼö ¸í·É¾î Á¤¸® + Ãʱ⼳Á¤  
 ±Û¾´ÀÌ:tejateja

, Hit : 32

#########^#########^#########^#########^#########^

# 10.±âº»¸í·É¾î

#########^#########^#########^#########^#########^



#°ü¸®ÀÚ±ÇÇÑ È¹µæ

sudo -i



#¼ÒÀ¯ÀÚº¯°æ

chown -R °èÁ¤ µð·ºÅ丮/Æú´õ¸í



#ÆÐÅ°Áö¼³Ä¡ È®ÀÎ

dpkg -l|grep openssh



#¾ÐÃà Çϱâ

tar -cvzf xxx.tar.gz *

#¾ÐÃà Ç®±â

tar -xvzf xxx.tar.gz



#¿ìºÐÅõ ¹öÀüÈ®ÀÎ

lsb_release -a

> No LSB modules are available.

> Distributor ID: Ubuntu

> Dedeleted ion:    Ubuntu 20.04.6 LTS

> Release:        20.04

> Codename:       focal



#¾÷µ¥ÀÌÆ®

apt update



#¾÷±×·¹À̵å(ÀÇÁ¸¼º Æ÷ÇÔ)

apt dist-upgrade



#ÇÊ¿ä¾ø´Â ÆÄÀÏ Á¤¸®

apt autoremove



# ÆÐÅ°ÁöÆÄÀÏ ¼³Ä¡(ex)

dpkg -i mysql-workbench-community_8.0.15-1ubuntu18.04_amd64.deb

# ÆÐÅ°Áö ¼³Ä¡ ¿À·ù ½Ã

apt --fix-broken install





#########^#########^#########^#########^#########^

# 20.ssh/³×Æ®¿öÅ©/¹æÈ­º® ±âº»

#########^#########^#########^#########^#########^



#netstat ¼³Ä¡

apt install net-tools



#########^#########^#########^

# openssh ¼³Ä¡

#########^#########^#########^

apt-get install openssh-server

#ssh½ÃÀÛ

service ssh start



#########^#########^#########^

# service È®ÀÎ

#########^#########^#########^

service --status-all

# + means it's running,

# - means it isn't (it might have crashed - it might never have started), and

# ? means the services doesn't have a status command, so there's no way the service command can work out what's what.

service --status-all|grep +

service --status-all|grep -

service --status-all|grep ?



#########^#########^#########^

# iptables(¹æÈ­º®)

#########^#########^#########^

#01.¼³Á¤ È®ÀÎ

iptables -nL

#02.iptalbes ÃʱâÈ­

iptables -F

#03.±âº» Á¤Ã¥ ¼³Á¤

iptables -P INPUT DROP

iptables -P FORWARD DROP

iptables -P OUTPUT ACCEPT

#04.TCP PORT 22 open -- ¿ø°ÝÀÛ¾÷½Ã 4>>3À¸·Î ÁøÇà!!

iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT

#05.localhost ¸ðµÎÇã¿ë

iptables -A INPUT -i lo -j ACCEPT

#06.established and related Á¢¼ÓÇã¿ë(ex:firefox)

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

#07.DNS TCP 53 / UDP 53 (*¼±ÅÃ)

iptables -A INPUT -p tcp --dport 53 -j ACCEPT

iptables -A INPUT -p udp --dport 53 -j ACCEPT

#08.FTP passive mode (*¼±ÅÃ)

iptables -A INPUT -p tcp --dport 21 -j ACCEPT

iptables -A OUTPUT -p tcp --sport 21 -j ACCEPT

iptables -A INPUT -p tcp --dport 1024:65535 -j ACCEPT

iptables -A OUTPUT -p tcp --sport 1024:65535 -j ACCEPT

#09.web 80, 443, 8080 (*¼±ÅÃ)

iptables -A INPUT -p tcp --dport 80 -j ACCEPT

iptables -A INPUT -p tcp --dport 443 -j ACCEPT

iptables -A INPUT -p tcp --dport 8080 -j ACCEPT

iptables -A INPUT -p tcp --dport 3306 -j ACCEPT

iptables -A INPUT -p tcp --dport 9000 -j ACCEPT

iptables -A INPUT -p tcp --dport 9443 -j ACCEPT

iptables -A INPUT -p tcp --dport 9080 -j ACCEPT

iptables -I INPUT -p tcp --dport 1022 -j ACCEPT



#»ç¿ëÁßÀÎ PortÈ®ÀÎ

netstat -antp



#¿­¸° Æ÷Æ® È®ÀÎ

netstat -tulpn | grep LISTEN

# ip v6 disable

nano /etc/sysctl.conf

## Ãß°¡

net.ipv6.conf.all.disable_ipv6=1

net.ipv6.conf.default.disable_ipv6=1

net.ipv6.conf.lo.disable_ipv6=1

## Àû¿ë

sysctl -p

service network restart

## ¼­¹öÀç½ÃÀÛ

reboot now



# ¹æÈ­º®¼³Á¤ ÀúÀå

service iptables save

  >>iptables: unrecognized service

##À§ ¸Þ½ÃÁö´Â ¾Æ·¡ ¼³Ä¡

apt install iptables-persistent

  >>ip4 ¿¹/ip6 ¿¹

netfilter-persistent save

netfilter-persistent reload

#11.ÀúÀåµÈ ·ê È®ÀÎ

ls /etc/iptables

  >rules.v4  rules.v6

#12.init ¼³Á¤/½ÇÇà

cp /usr/share/netfilter-persistent/plugins.d/15-ip4tables /etc/init.d/iptables

/etc/init.d/iptables start

/etc/init.d/iptables flush

#13.ºÎÆà ½Ã ÀÚµ¿½ÇÇà

update-rc.d -f iptables defaults

  >insserv: warning: deleted ‘K01iptables’ missing LSB tags and overrides

  >insserv: warning: deleted ‘iptables’ missing LSB tags and overrides

##À§ ¿¡·¯ /etc/init.d/iptables ¸Ç¾Æ·¡ Ãß°¡

 ### BEGIN INIT INFO

 # Provides: skeleton

 # Required-Start: $remote_fs $syslog

 # Required-Stop: $remote_fs $syslog

 # Default-Start: 2 3 4 5

 # Default-Stop: 0 1 6

 # Short-Dedeleted ion: Example initdeleted

 # Dedeleted ion: This file should be used to construct deleted s to be

 # placed in /etc/init.d.

 ### END INIT INFO

#14./etc/network/interface ¸Ç¾Æ·¡Ãß°¡(*¼±ÅÃ)

pre-up iptables-restore < /etc/iptables/rules.v4





################

# ipv6 disable #

################

## È®ÀÎ

    $ ifconfig -a | grep inet6

## ¼öÁ¤

    $ nano /etc/sysctl.conf

## ¾Æ·¡ Ãß°¡

    net.ipv6.conf.all.disable_ipv6 = 1

    net.ipv6.conf.default.disable_ipv6 = 1

## Àû¿ë

    $ sysctl -p





###########

# DNS¼³Á¤ #

###########

nano /etc/resolv.conf



nameserver 168.126.63.1

nameserver 168.126.63.2

options edns0



#DNSÈ®ÀÎ

nslookup

>server



$ apt-get install nm-tray network-manager

$ systemctl start NetworkManager

$ systemctl enable NetworkManager





#########^#########^#########^#########^#########^

# µð½ºÅ© ÆÄƼ¼Ç/Æ÷¸ä/¸¶¿îÆ®

#########^#########^#########^#########^#########^

# µð½ºÅ©È®ÀÎ

fdisk -l

#fdisk½ÇÇà

fdisk [/dev/sda]

  >m ¸í·É¾îº¸±â

  >d ÆÄƼ¼Ç»èÁ¦

  >n ÆÄƼ¼Ç»ý¼º

    >¿£ÅÍ ½Ã Àüü(default) ½ÇÇà

  >w ÀúÀå ÈÄ Á¾·á

  >ÀçºÎÆÃÀÌ ÇÊ¿äÇÒ ¼ö µµ ÀÖ´Ù.

  >reboot now

#Æ÷¸ä ext4¹æ½Ä

mkfs.ext4 [/dev/sdb1]

#ƯÁ¤Æú´õ¿¡ ¸¶¿îÆ®

mount -t /dev/sda /app/data1

#±ÇÇѺ¯°æ

chown -R [°èÁ¤¸í] [/app/data1]

#¾ð¸¶¿îÆ®

umount /dev/sda

##ÀÚµ¿¸¶¿îÆ®(ÀçºÎÆÃÈÄ¿¡µµ¸¶¿îÆ®)

#UUIDÈ®ÀÎ

ls -l /dev/disk/by-uuid/

#fstabµî·Ï

nano /etc/fstab

#¸¶¿îÆ®

mount -a



#µð½ºÅ©È®ÀÎ

lsblk





#########^#########^#########^#########^#########^

# XRDP ¼³Ä¡

#########^#########^#########^#########^#########^

1. apt-get update

2. apt-get install xrdp mate-core mate-desktop-environment mate-notification-daemon -y

3. sed -i.bak '/fi/a #xrdp multiple users configuration \n mate-session \n' /etc/xrdp/startwm.sh

4. ufw allow 3389/tcp





#########^#########^#########^#########^#########^

# D2Coding font ¼³Ä¡

#########^#########^#########^#########^#########^

mkdir ~/.local/share/fonts

cd ~/.local/share/fonts

wget https://github.com/naver/d2codingfont/releases/download/VER1.3.2/D2Coding-Ver1.3.2-20180524.zip

unzip D2Coding-Ver1.3.2-20180524.zip

#2. ÆùÆ® ij½Ã Áö¿ì°í ´Ù½Ã »ý¼º

fc-cache -f -v

#3. Àß ¼³Ä¡ µÇ¾ú´ÂÁö È®ÀÎ

fc-list | grep "D2Coding"

#4. û¼Ò

rm -rf D2Coding*



#########^#########^#########^#########^#########^

# docker ¼³Ä¡

#########^#########^#########^#########^#########^

apt update

apt dist-upgrade

apt autoremove



#ÇÊ¿ä ÆÐÅ°Áö ¼³Ä¡

sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common



#DockerÀÇ °ø½Ä GPGÅ° Ãß°¡

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -



#Docker°ø½Ä apt ÀúÀå¼Ò Ãß°¡

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"



apt update

apt dist-upgrade

apt autoremove



#Docker ¼³Ä¡

sudo apt-get install docker-ce docker-ce-cli containerd.io



sudo systemctl status docker

sudo docker run hello-world



#sudo systemctl start docker

#sudo gpasswd -a "${USER}" docker





 

  tejateja
ȸ¿ø´ÔÀÇ ¼Ò°³±ÛÀÌ ¾ø½À´Ï´Ù.
Á¤º¸·Â:510
Ä£Àýµµ:202

´ñ±Û¾²±â     ÀÛ¼ºÀÚ   Æнº¿öµå