전체 글 272

서버 셋팅 설정

vim /etc/ssh/sshd_config 1. 기본 접속 port 변경 Port {PortNum} 2. Root 로그인 차단 PermitRootLogin no 3. 계정 권한 분리 UserPrivilegesSeparation sandbox 4. 암호 없는 계정 접속 차단 PermitEmptyPasswords no 5. 로그인 실패 시 강제 종료 MaxAuthTries 5 6. 로그인 제한 시간 설정 LoginGraceTime 30 7. 접속 계정 제한 AllowUsers {계정이름}@{접속IP} semanage port -a -t ssh_port_t -p tcp {PortNum} systemctl status sshd.service

리눅스 (centos) 취약점 점검

계정 관리 U-1 root 계정 원격 접속 제한 vim /etc/pam.d/login auth required /lib/security/pam_securetty.so test cat /etc/securetty | grep pts* pts* 관련 설정이 있다면 제거 U-2 패스워드 복잡성 설정 1. 사용 최대 기간, 변경 최소 기간, 최소 길이, 변경 만료 알림 설정 vim /etc/login.defs PASS_MAX_DAYS 60 PASS_MIN_DAYS 7 PASS_MIN_LEN 10 PASS_WARN_AGE 10 test cat /etc/login.defs | grep PASS_ 2. 대문자, 소문자, 숫자 기호 설정 vim /etc/security/pwquality.conf minlen = 10 m..

Linux-centos 2021.02.26

aws bitnami mysql 암호 분실

cat bitnami_application_password 여기서 나오는걸로 일단 도전해보고 안되면 UPDATE mysql.user SET authentication_string=password('암호') WHERE user='root'; FLUSH PRIVILEGES; ALTER USER 'root'@'localhost' IDENTIFIED BY '암호'; FLUSH PRIVILEGES; UPDATE mysql.user SET password=PASSWORD('암호') WHERE user='root' FLUSH PRIVILEGES; FLUSH PRIVILEGES UPDATE mysql.user SET authentication_string=password('암호') WHERE user='root'; F..

CloudServer 2021.02.10

sanic 멸망편

no module named Crypto -> pip uninstall crypto -> pip install pycrypto no module named dill pip install dill==0.2.7.1 no module named sudo gunicorn -w 2 -b 0.0.0.0:8000 --chdir /프로젝트설치경로 wsgi:app & spacy ~ 블라블라 에러가 나는경우 ->sanic 관련 라이브러리들 버젼이 전부 엉망이라서 발생하는 경우 ->sanic 관련된 애들 다 지우고 다시 설치하는게 깔끔함 sanic==0.8.3 sanic-cors==0.9.6 Sanic-Plugins_framework==0.6.3.dev20180717 cython==0.25 cymem==2.0.2 presh..

접속

import gspread from oauth2client.service_account import ServiceAccountCredentials gc = gspreade.service_account(filename='CredentialFileName.json') sp_url = '엑셀파일주소' doc = gc.open_by_url(sp_url) sheet = doc.worksheet('시트1') print(sheet.get_all_records()) credeintialFileName.json의 client_email에 있는 값을 스프레드 시트의 공유에서 추가해야함 #한개씩 입력 sheet.update_acell('A1', 'DATA') #여러개 한꺼번에 입력 d = { 'range': 'A1:C1',..

API/API__google 2021.02.01