In this article, I’ll show you how to enable public key authentication on an SG300 Cisco switch and how to generate the public and private key pairs using puTTYGen. I’ll then show you how to login using the new keys.
![]()
Q: I have a Cisco switch in my network, which I can access by hooking up a console cable directly to the device. I like to access the switch remotely using SSH. How can I enable ssh on my Cisco 3750 Catalyst Switch?
A: By default, when you configure a Cisco device, you have to use the console cable and connect directly to the system to access it. Follow the steps mentioned below, which will enable SSH access to your Cisco devices. Once you enable SSH, you can access it remotely using PuTTY or any other SSH client. 1. Setup Management IP
First, make sure you have performed basic network configurations on your switch. For example, assign default gateway, assign management ip-address, etc. If this is already done, skip to the next step.
In the following example, the management ip address is set as 192.168.101.2 in the 101 VLAN. The default gateway points to the firewall, which is 192.168.101.1
2. Set hostname and domain-name
Next, make sure the switch has a hostname and domain-name set properly.
3. Generate the RSA Keys
The switch or router should have RSA keys that it will use during the SSH process. So, generate these using crypto command as shown below.
Also, if you are running on an older Cisco IOS image, it is highly recommended that you upgrade to latest Cisco IOS.
4. Setup the Line VTY configurations
Setup the following line vty configuration parameters, where input transport is set to SSH. Battle for middle earth key. Set the login to local, and password to 7.
If you have not set the console line yet, set it to the following values.
5. Create the username password
If you don’t have an username created already, do it as shown below.
Note: If you don’t have the enable password setup properly, do it now.
Make sure the password-encryption service is turned-on, which will encrypt the password, and when you do “sh run”, you’ll seee only the encrypted password and not clear-text password.
5. Verify SSH access
From the switch, if you do ‘sh ip ssh’, it will confirm that the SSH is enabled on this cisco device.
Generate Ssh Key Cisco 2960 Mac
After the above configurations, login from a remote machine to verify that you can ssh to this cisco switch.
In this example, 192.168.101.2 is the management ip-address of the switch.
> Add your comment
If you enjoyed this article, you might also like.
Next post: How to Backup Oracle Database using RMAN (with Examples)
Previous post: How to Use C++ Single and Multiple Inheritance with an Example
今日はSSHの設定方法を勉強します。
まだまだTelnet接続を使用している環境も多いと思いますが、世の中的にはManagementアクセスもよりセキュアにする方向に向かっているので、Telnetは割愛しました。
Catalystに192.168.1.1を設定し、SSHによるリモートアクセスを確認します。
Generate Ssh Key
IPの設定とインターフェースの開放
ログインUsernameとPasswordを作成し、vtyに設定。接続方法をSSHに限定。
ホスト名、ドメイン名の設定、RSA鍵の作成
SSHv2に限定
特権パスワードの設定
UsernameとPasswordはコンソール接続、リモート接続で共通のものを
username secret コマンドで設定します。password コマンドでも設定できますが、セキュリティ上username secret を使用することが推奨されます。この辺りは前回書きました。http://qiita.com/jinnai73/items/a240bf2bc1325b46edfe パスワードを作成したら login local コマンドでlineに適用します。Telnet接続を禁止するため、transport input コマンドでsshでのログインのみ許可します。
続いてSSH接続に必要なRSA鍵を作成します。RSA鍵を確認するコマンドは
show crypto key mypubkey rsa です。
何も入っていませんね。鍵を生成するコマンドは
crypto key generate rsa ですが、生成する前提としてスイッチのFQDN、つまりホストとドメイン名が決まっている必要があります。デフォルトではドメイン名が設定されていないため、以下のようなエラーが出ます。
How To Generate FIFA 20 Key?1– Open our FIFA 20 Key Generator.2– Register your free account.3– Select the platform (PC, PS4, XONE).4– Click “Generate CD Key”.5– Your unique FIFA 20 key will be shown to you.6– Click activate a key.7– Complete one task of your choice.8– Done. You need to be fast, every day someone redeems these keys. Dead space steam key generator.
ドメイン名の設定は
ip domain-name コマンド、確認はshow hosts で行えます。
それではホスト名とドメイン名を設定しましょう。
設定できました。これでRSA鍵も生成可能になります。
crypto key generate rsa コマンドで生成、鍵長は2048 bitを指定します。
![]()
警告メッセージにもある通り、2048 bitでは約1分ほど時間がかかりますが、2016年現在1024 bit以下のRSAは(少なくともインターネット上では)使わない方が良いというのは異論が無いところでしょう。
この時点でSSHでの接続が可能になります。テストのため自分自身に接続してみましょう。
できました。sshのv1はセキュリティに問題があるため禁止しましょう。一度ログアウトして、sshをv2に限定したのちに、v1での接続ができないことを確認します。
Cisco Ssh Rsa Key
うまくできています。この状態ではSSHアクセスした後に特権モードに入ろうとしてもできないため、
enable secret で特権パスワードの設定もしておきましょう。
Generate Ssh Key Cisco Router
思ったよりボリュームが増えてしまいました。明日ももう少し、機器管理を勉強しようと思います。
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2020
Categories |