2013년 11월 25일 월요일

리눅스 하드디스크 포맷 및 마운트 for me

테스트 환경 : 우분투 12.04(LTS) 서버 

  $ sudo su - root

root권한으로 장착된 디스크 목록 확인.

  # fdisk -l
디스크 목록 확인

만약 파티션 설정 및 포맷하려는 디스크가 /dev/sdd/라면
# fdisk /dev/sdd
원하는 데로 파티션 설정 후 저장
파티션 설정 및 저장

포맷
# mkfs.ext3 /dev/sdd1
디스크 포맷

마운트 할 디렉터리 생성
# mkdir /mnt/hdd3

마운트
# mount -t ext3 /dev/sdd1 /mnt/hdd3

마운트 확인
# df -h

부팅시 자동 마운트를 위해 /etc/fstab 수정

# vi /etc/fstab

UUID=deivceuuid /mnt/hdd3 ext3 default 0 2


ssh 설정 for me

파일경로 /etc/ssh/sshd_config
sshd_config 설정 링크


# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
# 포트 번호 설정
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
# 접속 허용할 IP 설정 0.0.0.0은 모든 IP 허용
#ListenAddress ::
#ListenAddress 0.0.0.0
# 프로토콜을 1을 사용할지 2를 사용할지의 여부.
# 보안상 2를 사용함.
# 프로토콜 1 vs 2 관련 링크
# Protocol 2,1
Protocol 2

# AllowUsers id1 id2 id3
# AllowGroups 허용할 그룹
# DenyGroups DenyUsers

AllowUsers 규규
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768

# Logging  로그 파일 /var/log/auth.log
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120 #
PermitRootLogin no # root 로그인 허용 여부
StrictModes yes # 파일체크 모드 여부
MaxAuthTries 6 # 로그인 실패3회이상 로그 6회까지 시도 가능
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys

# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes