Skip to main content

Posts

Showing posts from 2015

TFTP server

Tips:  複数インターフェースがあるLinuxでTFTPを利用した場合に意図しないインターフェースが送信元として、通信していてルーティングが失敗していることが分かった。/var/log/messageで以下のログが表示される。 参照リンク https://chriscowley.me.uk/blog/2013/03/25/writeable-tftp-server-on-centos/ http://blog.tsunokawa.net/entry/2014/07/18/164213 https://genchan.net/server/5363 http://www.petenetlive.com/KB/Article/0000998.htm 環境 step1. yumでtftp client とtftp-serverをインストール yum install tftp tftp-server step2 . /etc/xinetd.d/tftp に以下を設定 オプションの意味 -c で他ホストからのアップロードを許可します。 service tftp { socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -c -s /var/lib/tftpboot disable = no per_source = 11 cps = 100 2 flags = IPv4 } step3.   xinetd を onにして、tftpを起動させる 自動起動の場合はchkconfig xinetd onを入力 # chkconfig xinetd on # chkconfig --list xinetd xinetd          0:off   1:off   2:on    3:on    4:on    5:on 自動起動をしない場合は以下のみ # service xinetd start 設

syslog

■Syslog directory ■参照リンク https://www.express.nec.co.jp/linux/distributions/knowledge/system/realtime_log.html /var/log/message tail -f n 10 /var/log/messageとすると10行分の最新ログが表示される。 # tail -f -n N /var/log/message

VMWARE: VMWAREのMACの手動設定

VMWAREのMACアドレスを自動生成ではなく、MACの手動設定する方法。 Link ----------------------------------------- http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1010675 http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2035707 http://kb.vmware.com/selfservice/search.do?cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=2052143 以下、2つのVM実行ファイルの追加例。 ----------------------------------------- ethernetN.checkMACAddress = "false" ethernetN.addressType = "static" ethernetN.Address = "XX:XX:XX:XX:XX:XX" 00:0c:29:5a:31:b7 00:0c:29:5a:31:c1 ethernet0.checkMACAddress = "false" ethernet0.addressType = "static" ethernet0.Address = "00:0c:29:5a:31:b7" ethernet1.checkMACAddress = "false" ethernet1.addressType = "static" ethernet1.Address = "00:0c:29:5a:31:c1" -------------------------------------

Command: find

xargsは前のコマンドの引数をすべて渡すコマンド。 Link http://qiita.com/amasok23/items/5773cc3460c31163052f http://kawatama.net/web/1141 https://hydrocul.github.io/wiki/commands/xargs.html [root@cent2 ~]# find ./hoge* -type f -print | xargs grep 'filter' ./hoge10.txt: <Criteria fieldName="name" filterString="an@123.com" match="equals"/> ./hoge11.txt: <Criteria fieldName="status" filterString="Known" match="equals"/> ./hoge13.txt: <Criteria fieldName="status" filterString="Known" match="equals"/> ./hoge3-3.txt: <Criteria fieldName="name" filterString="mike" match="equals"/> [root@cent2 ~]# find ./hoge* -type f -print | xargs grep 'Filter' ./hoge10.txt:<Filter entity="GuestUser"> ./hoge10.txt:</Filter> ./hoge11.txt:<Filter entity="Endpoint"> ./hoge11.txt:</Filter> ./hoge13.txt:<Filter en

NTP and timezone setting

ntpdate ntp.nict.jp more /usr/share/zoneinfo/Asia/Tokyo  strings /etc/localtime date strings - ファイル中の表示可能な文字列を表示する  ------------------------------------- referring pages http://qiita.com/azusanakano/items/b39bd22504313884a7c3 ------------------------------------- [root@ale ~]#  ntpdate ntp.nict.jp 30 Mar 06:22:31 ntpdate[24908]: adjust time server 133.243.238.244 offset 0.001409 sec [root@ale ~]# date Mon Mar 30 06:22:34 UTC 2015 [root@ale ~]#  strings /etc/localtime TZif2 TZif2 UTC0 [root@ale ~]#  more /usr/share/zoneinfo/Asia/Tokyo  ヒロロォレ€ワ ン蕎€(65%) JST-9      [root@ale ~]#  cp /etc/localtime /etc/localtime.org cp: overwrite `/etc/localtime'? yes [root@ale ~]#  strings /etc/localtime TZif2 TZif2 JST-9 [root@ale ~]#  date Mon Mar 30 15:26:27 JST 2015 [root@ale ~]#

ncftp FTP client

参考リンク ncftpのコマンド試した履歴 ------------------------------------------------- ncFTP http://www.ncftp.com/ncftp/ http://peryaudo.hatenablog.com/entry/20100601/1275402835 http://lovepeers.org/2012/09/21/ftp-upload-recursively/ http://linux.math.tifr.res.in/manuals/man/ncftp.html http://www.ncftp.com/ncftp/doc/ncftp.html BusyBox http://www.busybox.net/downloads/BusyBox.html ------------------------------------------------- Option: connect-timeout Previous versions of the program used a single timeout value for everything. You can now have different values for different operations. However, you probably do not need to change these from the defaults unless you have special requirements.   The  connect-timeout  variable controls how long to wait, in seconds, for a connection establishment to complete before considering it hopeless. You can choose to not use a timeout at all by setting this to -1. control-timeout This is the timer used when  ncftp  sends an FTP command over the

IAP-XML-API curl

IAP-XML-API [root@cent2 ~]# curl --insecure -d 'xml=<aruba command="user_authenticate"><ipaddr>10.215.1.59</ipaddr><name>user1</name><password>aruba123</password><key>aruba123</key><authentication>cleartext</authentication><version>1.0</version></aruba>' 'https://10.215.1.208/auth/command.xml' [root@cent2 ~]# curl --insecure -d 'xml=<aruba command="user_query"><ipaddr>10.215.1.59</ipaddr><key>aruba123</key><authentication>cleartext</authentication><version>1.0</version></aruba>' 'https://10.215.1.208/auth/command.xml' <?xml version='1.0'?>

find

find 「検索ディレクトリ」 「検索条件」 「コマンド」 find ディレクトリ -name 引数の後に正規表現 [root@cent2 named]# find / -name named.conf /etc/dbus-1/system.d/named.conf /usr/share/logwatch/default.conf/services/named.conf /usr/share/doc/bind-9.3.6/sample/etc/named.conf [root@cent2 named]# find . -type f ./chroot/etc/localtime ./chroot/etc/rndc.key [root@cent2 python]# find . -type f -print 「/usr/local」「/usr/bin」「/usr/sbin」と3つのディレクトリの全ファイルを表示する場合 find /usr/local /usr/bin /usr/sbin -type f -print

tail command

tail コマンド説明 参照リンク http://kazmax.zpp.jp/cmd/t/tail.1.html # tail -f -n N /var/log/message tail -f "-f" is used when the file is increasing. ファイルの内容がどんどん増え続けているものと仮定し、 ファイルの最終部分の文字を読み続けようと無限にループする。 パイプから読み込んでいる場合は無視される。 2 つ以上のファイルが指定された場合は、 tail  は異なったファイルの追加分を受け付けるごとにヘッダを表示し、 出力がどのファイルに由来するものかがわかるようにする。 ファイルの追跡方法を指定することもできる。  [root@ale ~]# tail -f /opt/ale/var/log/ls.py/current ##Building fetch failed, try fetching again in 2 mins 11:42:31.096 037409.096082 T:7f2c75219700:location:ERROR* *** "/var/arubaobjs/ls_campus/ls_campus.ser" needs to be generated first, will sleep and wait here... 11:42:41.097 037419.097359 T:7f2c75219700:location:ERROR* *** "/var/arubaobjs/ls_campus/ls_campus.ser" needs to be generated first, will sleep and wait here... <snip> Archive already exists Fetching https://10.215.1.103/visualrf/campus.xml?buildings=1&sites=1&images=1 Removing cookie file Generating cookie Successfully

Tool: ciphersuite check for server side

Cipherscan: SSL Ciphersuiteの調査ツール Android API: Install Cipherscan Cipherscan is useful to check support of SSL ciphersuite of server side. # yum install git #git clone https://github.com/jvehent/cipherscan.git [root@cent opt]# cd cipherscan/ [root@cent cipherscan]# ls analyze.py  ca-bundle.crt  cipherscan  openssl  openssl-darwin64  OpenSSL-LICENSE  README.md  top1m # openssl ciphers -v | sort #./cipherscan -o ./openssl-mine 10.215.200.192:4343 Scanning AOS6.1.3, 6.3 and IAP.4.1. Scanning AOS6.1.3 [root@cent cipherscan]# ./cipherscan -o ./openssl-mine 10.215.103.207:4343 custom openssl not executable, falling back to system one from /usr/bin/openssl ..... Target: 10.215.103.207:4343 prio  ciphersuite           protocols              pfs_keysize 1     DES-CBC3-SHA          TLSv1,TLSv1.1,TLSv1.2 2     AES256-SHA            TLSv1,TLSv1.1,TLSv1.2 3     AES128-SHA            TLSv1,TLSv1.1,TLSv1.2 4     EDH-RSA-DES-CBC3-SHA  TLSv1,TLSv1.1,TLSv1.2  DH,1024bits C