[index] AT-AR2050V/AT-AR3050S/AT-AR4050S/AT-AR4050S-5G コマンドリファレンス 5.5.2
awplus(config)# username admin privilege 15 password adkf8KH! ↓
awplus(config)# crypto key generate hostkey rsa ↓ Generating host key (1024 bits rsa) This may take a while. Please wait ... Done WARNING: The SSH server must now be enabled with "service ssh"
awplus(config)# service ssh ↓
Noteservice sshコマンドの実行時にホスト鍵が1つも存在していない場合は、RSA鍵(1024ビット)とECDSA鍵(384ビット)が自動的に生成されます。
また、service sshコマンドの実行時にホスト鍵としてRSA鍵のみが存在し、ECDSA鍵が存在しない場合にも、ECDSA鍵(384ビット)が自動的に生成されます。
awplus(config)# ssh server allow-users manager ↓ awplus(config)# ssh server allow-users admin ↓
awplus(config)# end ↓ awplus# copy scp://pcuser@pchost.example.com/tmp/admin_id_rsa.pub flash ↓ Enter destination file name [admin_id_rsa.pub]: ↓ pcuser@pchost.example.com's password: XXXXXXXX ↓ (実際には表示されません) Copying.. Successful operation
Noteリモートコピーの方法については、copyコマンドのページや「運用・管理」の「ファイル操作」をご覧ください。
awplus# configure terminal ↓ Enter configuration commands, one per line. End with CNTL/Z. awplus(config)# crypto key pubkey-chain userkey admin admin_id_rsa.pub ↓
awplus(config)# ssh server allow-users manager 192.168.10.186 ↓
awplus(config)# ssh server allow-users manager 192.168.10.* ↓
Noteワイルドカードを用いてIPアドレスを範囲指定した場合、「% Warning: ssh server resolve-hosts is not enabled.」という警告メッセージが出ますが、次項で述べる「ホスト名による指定」を使っていない場合は無視してかまいません。
Noteアクセスが許可されていないホスト/ユーザーからSSHでログインしようとした場合、コンソール上に「sshd[3374]: fatal: mm_request_receive_expect: read: rtype 48 != type 46」のようなデバッグメッセージが表示されます。
awplus(config)# ip name-server 172.16.10.8 ↓ awplus(config)# ssh server resolve-hosts ↓ awplus(config)# ssh server allow-users admin delirium.example.com ↓
Notessh server resolve-hostsコマンドを実行せずにホスト名を指定した場合は「% Warning: ssh server resolve-hosts is not enabled.」という警告メッセージが出ます。ホスト名を指定する場合は必ずssh server resolve-hostsコマンドを実行して、ホスト名の逆引きを有効化してください。逆引きが無効の場合、ホスト名パターンを含むエントリーには一切マッチしませんのでご注意ください。
awplus# show ssh server ↓
awplus# show crypto key hostkey ↓ Type Bits Fingerprint ------------------------------------------------------------- rsa 1024 SHA256:I3Tbsf+kH0PWeOXyMTNOTLgkz5woddKO8cPlH4RzINQ awplus# show crypto key hostkey rsa ↓ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDLg+3ftT+7vUu0d/HHF8EZBhRD1ssEmGK58zAzFZ2O /JGjts6guSF1F8bLVUmsTy6FdT4M0jtsMDuJSxGq7FqO6Oz/D7IUlaUp+ygmVR7ovbrvHJrb88iWIb6I UWHfZCSSs3biTtC4t8Cmdje6LmBYQRUk+7KgLu00MlidMbuTgw==
awplus# show crypto key pubkey-chain userkey admin ↓ No Type Bits Fingerprint Comment ------------------------------------------------------------------------------- 1 rsa 4096 SHA256:iJ18qK5lVV3sT/jMvflfAInORmLgsf3L5TmDZt3J admin@pc awplus# show crypto key pubkey-chain userkey admin 1 ↓ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCX5FS6ZRCR/Wkl3PiFxum0czn1QCViNUZoTiwbYWOW FCtg57erbjaC3OzsWWtHiC+q/pIahCvAGo8XJWBW1F0ckPWBIkhLmyLaxwtAEPLY/KT2lhDen9TJt3Uv nNNQImTL5ZA1+c3JvNjEsSwUun3mi6gLG/QpUsXSwnz6m5J6AJbnEWLnniYBlQHUelBgTmh6W9eDjfCW SNxvQco9aHpgQOg2vTAgxboGCAiiVSgrxAYR5SxUGnshuLw8d3mdQSI6W08BvTFA9QzuYaa4eBnf43Of utA7yeVQ3m/2845CKMjrgCvvQ7isxhK1qhHuSjcGR8H58mCf75V7Wnut+o3ksc8Ts4m1BK5JEE5BWV7H Zxx3pN01L1RgxNqqTUWcMpi53BDqhBaSxDmciUPW3ZzFkLs2V6oCZ82jl/KCPCOmENcVHjCU80l4YaOx 0OEyn1aYIbqlOC1+lBNGIpUByvfRx1W13TztrIXqqPwnsn5dsdcZlqm8jtOzf39vwD37tdH3F3bOL3ei xBlDlDl87q43sw5Y+RHRz/n7/nxRTnqbFEvnWf8f09bShFRbGWjm3NmbVq+b6NRRsaLgw7qRqOsLf7TG TQGMw+rpEpaAaAIFNd5Yn9pVOKYMNt+ibsNmkGMWF/j+D/aPh/PZSXidbo5mouMFnKvUXebX1cGhEQ+Q 2w== admin@pc
awplus> show users ↓
awplus# show ssh ↓ Secure Shell Sessions: ID Type Mode Peer Host Username State Filename ------------------------------------------------------------------------------ 3402 ssh server 192.168.20.2 admin open
awplus# clear ssh 3402 ↓
awplus# ssh user zein 192.168.10.5 ↓ The authenticity of host '192.168.10.5 (192.168.10.5)' can't be established. RSA key fingerprint is 35:7f:a5:0d:f1:70:a7:e4:5c:b2:27:fe:54:d8:9a:f3. Are you sure you want to continue connecting (yes/no)? yes ↓ Warning: Permanently added '192.168.10.5' (RSA) to the list of known hosts. zein@192.168.10.5's password: XXXXXXXX ↓ (実際には表示されません) Last login: Wed Sep 14 14:01:55 2011 from awplus Welcome to Darwin! [1488] zein@bird:~%
The authenticity of host '192.168.10.5 (192.168.10.5)' can't be established. RSA key fingerprint is 35:7f:a5:0d:f1:70:a7:e4:5c:b2:27:fe:54:d8:9a:f3. Are you sure you want to continue connecting (yes/no)?
Warning: Permanently added '192.168.10.5' (RSA) to the list of known hosts.
awplus> ssh user zein 192.168.10.5 ↓ zein@192.168.10.5's password:
awplus# ssh 192.168.10.5 ↓ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that the RSA host key has just been changed. The fingerprint for the RSA key sent by the remote host is f2:a8:87:eb:22:34:26:9b:2a:b2:2f:d2:16:b0:6c:89. Please contact your system administrator. RSA host key for 192.168.10.5 has changed and you have requested strict checking. Host key verification failed. awplus#
awplus# show crypto key pubkey-chain knownhosts ↓ No Hostname Type Fingerprint ------------------------------------------------------------------------- 1 afrika.example.c dsa a0:91:f6:52:b2:98:f5:9b:90:3d:51:82:96:15:29:24 2 192.168.10.2 dsa 71:45:be:18:35:42:03:85:1a:42:ae:b3:3f:37:d6:51 3 192.168.20.2 dsa 71:45:be:18:35:42:03:85:1a:42:ae:b3:3f:37:d6:51 4 172.16.10.3 dsa d3:d6:63:39:f4:ac:5d:c7:00:7a:28:dd:f3:a9:12:31 5 192.168.10.5 rsa 35:7f:a5:0d:f1:70:a7:e4:5c:b2:27:fe:54:d8:9a:f3 6 10.100.10.100 rsa 2a:6f:4f:c4:5f:6a:e6:35:1c:39:aa:38:c1:7b:a5:1c
awplus# configure terminal ↓ Enter configuration commands, one per line. End with CNTL/Z. awplus(config)# no crypto key pubkey-chain knownhosts 5 ↓ awplus(config)# end ↓
awplus# ssh user zein 192.168.10.5 ↓ The authenticity of host '192.168.10.5 (192.168.10.5)' can't be established. RSA key fingerprint is f2:a8:87:eb:22:34:26:9b:2a:b2:2f:d2:16:b0:6c:89. Are you sure you want to continue connecting (yes/no)? yes ↓ Warning: Permanently added 'localhost' (RSA) to the list of known hosts. zein@192.168.10.5's password:
awplus(config)# crypto key pubkey-chain knownhosts 192.168.10.5 rsa ↓ 192.168.10.5 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAxYYxBFU5Xyqyv0YfAyLg8TOrWvhG3VWoWv QX/MYTdym4uLRAejxBp1DEpRYuEe34j5i4oVfhYjhfCQthbzLAyaTAyTD40hHIvaJL+CAA3w+TjnTUIb bv+IdVGdr3v2i5U6TkXeSuxWWvc8jsPcRnrKGzEPRfWKH/w1KIGvyb9e8= Are you sure you want to add this public key (yes/no)? yes ↓
Notesshコマンドでコマンド行を指定したときは、指定したコマンド行の実行後にコネクションが切断されます。コマンド行を指定しなかったときは、前述のとおりSSHサーバーにログインして対話型セッションを開始します。
awplus# ssh user zein 10.100.10.100 netstat -an -f inet ↓ zein@10.100.10.100's password: XXXXXXXX ↓ (実際には表示されません) Active Internet connections (including servers) Proto Recv-Q Send-Q Local Address Foreign Address (state) tcp4 0 0 10.100.10.100.22 10.100.10.1.38199 ESTABLISHED tcp4 0 0 127.0.0.1.1033 127.0.0.1.976 ESTABLISHED tcp4 0 0 127.0.0.1.976 127.0.0.1.1033 ESTABLISHED tcp4 0 0 *.22 *.* LISTEN tcp4 0 0 *.* *.* CLOSED tcp4 0 0 *.80 *.* LISTEN tcp4 0 0 127.0.0.1.8005 *.* LISTEN tcp46 0 0 *.8009 *.* LISTEN tcp4 0 0 127.0.0.1.5432 127.0.0.1.49154 ESTABLISHED tcp4 0 0 127.0.0.1.49154 127.0.0.1.5432 ESTABLISHED tcp46 0 0 *.8080 *.* LISTEN tcp4 0 0 *.5432 *.* LISTEN tcp4 0 0 *.* *.* CLOSED tcp4 0 0 127.0.0.1.1033 127.0.0.1.1019 ESTABLISHED tcp4 0 0 127.0.0.1.1019 127.0.0.1.1033 ESTABLISHED tcp4 0 0 127.0.0.1.631 *.* LISTEN tcp4 0 0 *.23 *.* LISTEN tcp4 0 0 *.139 *.* LISTEN tcp4 0 0 127.0.0.1.1033 *.* LISTEN ... awplus#
awplus# copy scp://zein@10.100.10.100/tmp/testtest.cfg flash ↓ Enter destination file name [testtest.cfg]: zein@10.100.10.100's password: XXXXXXXX ↓ (実際には表示されません) Copying.. Successful operation
awplus# copy testtest2.cfg scp://zein@10.100.10.100/tmp/ ↓ Enter destination file name [testtest2.cfg]: zein@10.100.10.100's password: XXXXXXXX ↓ (実際には表示されません) Successful operation
awplus# copy sftp://zein@10.100.10.100/tmp/aaaaa.txt flash ↓ Enter destination file name [aaaaa.txt]: zein@10.100.10.100's password: XXXXXXXX ↓ (実際には表示されません) Copying.. Successful operation
(C) 2015 - 2022 アライドテレシスホールディングス株式会社
PN: 613-002107 Rev.AU