Xin chào ! Nếu đây là lần đầu tiên bạn đến với diễn đàn, xin vui lòng danh ra một phút bấm vào đây để đăng kí và tham gia thảo luận cùng VnPro.

Announcement

Collapse
No announcement yet.

Cấu hình SSH và HTTPS cho Router

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cấu hình SSH và HTTPS cho Router

    SSH và HTTPS
    Vì Telnet gửi tất cả các gói tin dưới dạng văn bản thuần, nó không an toàn. SSH cho phép quản lý từ xa một bộ định tuyến hoặc bộ chuyển mạch Cisco, nhưng không giống như Telnet, SSH mã hóa nội dung của các gói tin để bảo vệ chúng khỏi bị giải mã nếu rơi vào tay kẻ xấu.
    Để kích hoạt SSH trên bộ định tuyến hoặc bộ chuyển mạch, cần có các mục sau:
    • Tên máy chủ khác với tên mặc định là "router".
    • Tên miền.
    • Tạo một cặp khóa công khai/riêng tư, được sử dụng ngầm bởi SSH.
    • Yêu cầu đăng nhập người dùng qua các dòng vty, thay vì chỉ sử dụng mật khẩu. Xác thực cục bộ và xác thực bằng máy chủ ISE đều là tùy chọn.
    • Có ít nhất một tài khoản người dùng để đăng nhập, có thể là cục bộ trên bộ định tuyến hoặc trên máy chủ ISE.

    ! To create the public/private key pair used by SSH, we would issue the
    ! following command. Part of the key pair will be the hostname and the
    ! domain name.
    ! If these are not configured first, the crypto key generate command will
    ! tell you as shown in the next few lines. Router(config)# crypto key generate rsa
    % Please define a hostname other than Router. Router(config)# hostname R1
    R1(config)# crypto key generate rsa
    % Please define a domain-name first. R1(config)# ip domain-name cisco.com

    ! Now with the host and domain name set, we can generate the key pair R1(config)# crypto key generate rsa
    The name for the keys will be: R1.cisco.com
    Choose the size of the key modulus in the range of 360 to 2048 for your General Purpose Keys. Choosing a key modulus greater than 512 may take a few minutes.

    ! Bigger is better with cryptography, and we get to choose the size for the
    ! modulus.
    ! The default is 512 on many systems, but you would want to choose 1024 or
    ! more to improve security. SSH has several flavors, with version 2 being
    ! more secure than version 1. To use version 2, you would need at least a
    ! 1024 size for the key pair.
    How many bits in the modulus [512]: 1024
    % Generating 1024 bit RSA keys, keys will be non-exportable...
    R1(config)#
    R1> show ssh
    Connection Version Mode Encryption Hmac State Username
    0 2.0 IN aes128-cbc hmac-sha1 Session started omar
    0 2.0 OUT aes128-cbc hmac-sha1 Session started omar
    %No SSHv1 server connections running.

    Cấu hình https cho router:

    ! Enable the SSL service on the local router. If it needs to generate
    ! keys for this feature, it will do so on its own in the background. R1(config)# ip http secure-server

    ! Specify how you want users who connect via HTTPS to be authenticated. R1(config)# ip http authentication ?
    aaa Use AAA access control methods enable Use enable passwords
    local Use local username and passwords


    R1(config)# ip http authentication local


    ! If you are using the local database, make sure you have at least one user
    ! configured in the running-config so that you can login. To test, open
    ! a browser to HTTPS://a.b.c.d where a.b.c.d is the IP address on the
    ! router.
    Đặng Quang Minh, CCIEx2#11897 (Enterprise Infrastructure, Wireless), DEVNET, CCSI#31417

    Email : dangquangminh@vnpro.org
    https://www.facebook.com/groups/vietprofessional/
Working...
X