공유기 안에 리눅스 서버가 있을 때, ssh 접속속도가 느릴 경우가 있는데, 이는 접속자의 IP가 192.168.0.1 과 같은 공유기 IP로 인식되고, 이를 보안인증에서 네임을 해석하는 알고리즘에 지연현상이 발생하기 때문이다. 이 경우 다음과 같이 간단히 접속지연 문제를 해소할 수 있습니다. vi /etc/hosts 192.168.0.1 gateway
awk 로그파일 잘라내기
awk 'NR >= 1502077 && NR <= 1512089' ./xxx-stdout.log > 2789711.txt
Samba 관련 유용한 명령어들
[root@owl45 samba]# smbpasswd -a owl New SMB password: Retype new SMB password: Added user owl. [root@owl45 samba]# smbclient -L owl45 -l 192.168.0.45 -U owl Enter owl's password: Sharename Type Comment --------- ---- ------- public Disk Public Stuff IPC$ IPC IPC Service (OWL45) owl Disk Home Directories Server Comment --------- ------- Workgroup Master --------- ------- [root@owl45 […]
Samba install and settings
# yum install samba [root@owl43 public]# vi /etc/samba/smb.conf ================================== [global] workgroup = WORKGROUP server string = OWL45 log file = /var/log/samba/%m.log security = user passdb backend = tdbsam #encrypt passwords = yes #smb passwd file = /etc/samba/smbpasswd hosts allow = 127. 192.168.0. #socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 [homes] comment = Home Directories browseable […]
Network monitoring on Linux : iftop, nload, iptraf
CentOS : iptraf [root@owl43 ~]# yum install iptraf [root@owl43 ~]# iptraf
Midnight Commander toggle Mark files shortcut => Ctrl + t
Midnight Commander mark for select files Ctrl + T
Linux disk speed check - hdparm -tT
# hdparm -tT /dev/sdc
Resin 4 session timeout
vi /etc/resin/app-default.xml <web-app-default> <!-- configures the default class loader --> <class-loader> <compiling-loader path="WEB-INF/classes"/> <library-loader path="WEB-INF/lib"/> </class-loader> <session-config cookie-domain="mydomain.com"> <session-timeout>30</session-timeout> <session-max>4096</session-max> </session-config> OR vi /etc/resin/cluster-default.xml <resin xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin"> <cluster-default> <host-default> .... <session-config> <use-persistent-store>${session_store}</use-persistent-store> <session-timeout>480</session-timeout> <session-max>4096</session-max> <enable-url-rewriting>false</enable-url-rewriting> </session-config> </web-app-default> </host-default> </cluster-default> </resin>
Cent OS MySQL too slow
vi /etc/my.cnf [mysqld] skip-name-resolve
sftp parent directory lock chroot
[root@localhost owl]# vi /etc/ssh/sshd_config Subsystem sftp internal-sftp Match Group owl ChrootDirectory /home/owl/ #ChrootDirectory /home/owl/%u #ChrootDirectory %h ForceCommand internal-sftp [root@localhost owl]# chown root.root /home/owl [root@localhost owl]# chmod 755 /home/owl [root@localhost owl]# /etc/rc.d/init.d/sshd restart ChrootDirectory 에서 지정하는 폴더는 root 계정만 쓸 수 있다. 따라서, ChrootDirectory %h 와 같이 설정한다면, 사용자의 홈폴더는 읽기 […]