View Full Version : SSH for ASA5505
pabelkid
15-07-2010, 02:41 PM
Hi all,
Mạng của em như thế này/
Inside (192.168.1.2)-------(.1)ASA(10.0.1.1)-------(.2) outside/
dải địa chỉ Pool khi kết nối remote access là 192.168.2.1- .10/
Em đã tạo kết nối Remote access VPN từ Outside được đến inside. Nay em muốn qua kết nối VPN này có thể sử dụng SSH từ outside log vào ASA để quản lý con ASA này khi có vấn đề xảy ra. Mong các anh chỉ bảo/
dangquangminh
15-07-2010, 08:43 PM
2. Cấu hình SSH cho ASA
Bình thường ASA hỗ trợ 5 phiên SSH. SSH dùng TCP port 22. SSH có giao diện giống như telnet nhưng có nhiều chức năng bảo mật hơn. ASA có hỗ trợ cả hai version của SSH là SSH v1 và SSH v2. So với SSHv1, SSHv2 có thêm các chức năng về mã hóa và đảm bảo toàn vẹn dữ liệu.
Thực hiện các bước sau để bật chức năng SSH của ASA, ở chế độ config mode:
- Gán một domain name cho thiết bị. Bước này là bắt buộc do tên domain name thường được dùng trong quá trình tính toán cặp khóa RSA.
#domain-name vnpro.org
- Tạo ra cặp khóa RSA. Giá trị 1024 là số bit được dùng trong tính toán modulus.
#crypto key generate rsa modulus 1024
Lưu giá trị cặp khóa vừa tạo
#write memory
Nếu trong quá trình hoạt động, tên domain-name của thiết bị có thay đổi thì ta phải xóa cặp khóa và xây dựng lại. Câu lệnh để thực hiện tác vụ đó là
Firewall# crypto key zeroize rsa default
Cho phép SSH trên cổng inside
#ssh 10.0.3.0 255.255.255.0 inside
Gán thời gian timeout của các phiên telnet
#ssh timeout 2
Bật chức năng xác thực cho SSH, dùng cơ sở dữ liệu username/password cục bộ trên ASA:
#aaa authentication ssh console LOCAL
Bạn đã hoàn tất việc bật chức năng SSH trên ASA. Lúc này trên ASA tạo username/password để dùng cho quá trình xác thực của ASA. Tạo username/password cho config mode
#username vnpro password vnpro privilege 15
Sau đó, từ một máy trong cổng inside, dùng một phần mềm hỗ trợ SSH như Putty, SecureVRT để SSH vào ASA. Để xem các phiên SSH hiện có dùng các lệnh
# show ssh sessions
pabelkid
16-07-2010, 10:27 AM
Cam on bac!
em chua hieu cau lenh
# ssh 10.0.3.0 255.255.255.0 inside // Ở đây mạng inside của em là 192.168.1.0/24, outside là 10.0.1.0/24 và pool là 192.168.2.0/24.
và
Ở đây em muốn từ internet kết nối VPN tới ASA. sau đó dùng giao thức SSH để log từ xa vào ASA. Giúp việc quản lý ASA này từ xa.
khi tạo SSH từ xa như vậy thì việc thực hiện SSH tới các thiết bị trong mạng Inside có bị ảnh hưởng j không?
Mong các bác giúp em sớm.
Br/
dangquangminh
17-07-2010, 10:08 PM
Cấu hình mẫu trên site Cisco:
http://www.cisco.com/en/US/products/hw/vpndevc/ps2030/products_configuration_example09186a008069bf1b.sht ml
pabelkid
19-07-2010, 03:14 PM
Hic,
em làm theo cách này đã 3-4 lần rùi. Nhung chỉ khi cắm mạng Lan sử dụng trực tiếp không qua kết nối VPN thì được. Còn khi qua kết nối VPN thì lại không thể ssh được đến thiết bị
Câu lệnh :
: Saved
:
ASA Version 8.2(1)
!
hostname ciscoasa
enable password 2KFQnbNIdI.2KYOU encrypted
passwd 2KFQnbNIdI.2KYOU encrypted
names
!
interface Vlan1
nameif inside
security-level 100
ip address 10.11.32.251 255.255.255.0
!
interface Vlan2
nameif outside
security-level 0
ip address 110.35.74.6 255.255.255.0
!
interface Ethernet0/0
switchport access vlan 2
!
interface Ethernet0/1
!
interface Ethernet0/2
shutdown
!
interface Ethernet0/3
shutdown
!
interface Ethernet0/4
shutdown
!
interface Ethernet0/5
shutdown
!
interface Ethernet0/6
shutdown
!
interface Ethernet0/7
shutdown
!
ftp mode passive
access-list vpnra extended permit ip 10.11.32.0 255.255.255.0 192.168.0.0 255.255.255.0
pager lines 24
mtu inside 1500
mtu outside 1500
ip local pool testpool 192.168.0.1-192.168.0.20 mask 255.255.255.0
icmp unreachable rate-limit 1 burst-size 1
no asdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 0 access-list vpnra
route outside 0.0.0.0 0.0.0.0 110.35.74.5 1
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
timeout tcp-proxy-reassembly 0:01:00
dynamic-access-policy-record DfltAccessPolicy
aaa authentication ssh console LOCAL
http server enable
http 10.11.32.0 255.255.255.0 inside
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstart
crypto ipsec transform-set myset esp-des esp-md5-hmac
crypto ipsec security-association lifetime seconds 28800
crypto ipsec security-association lifetime kilobytes 4608000
crypto dynamic-map dyn1 1 set transform-set myset
crypto dynamic-map dyn1 1 set reverse-route
crypto map mymap 10 ipsec-isakmp dynamic dyn1
crypto map mymap interface outside
crypto isakmp identity address
crypto isakmp enable outside
crypto isakmp policy 2
authentication pre-share
encryption des
hash md5
group 2
lifetime 86400
crypto isakmp ipsec-over-tcp port 10000
telnet timeout 5
ssh 0.0.0.0 0.0.0.0 outside
ssh 192.168.0.0 255.255.255.255 outside
ssh timeout 60
console timeout 0
threat-detection basic-threat
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
webvpn
username testuser password pU4oyO2h2X5.LJuf encrypted
username thac86 password d60EeaA01L21wNfU encrypted privilege 15
tunnel-group testgroup type remote-access
tunnel-group testgroup general-attributes
address-pool testpool
tunnel-group testgroup ipsec-attributes
pre-shared-key *
!
class-map inspection_default
match default-inspection-traffic
!
!
policy-map type inspect dns preset_dns_map
parameters
message-length maximum 512
policy-map global_policy
class inspection_default
inspect dns preset_dns_map
inspect ftp
inspect h323 h225
inspect h323 ras
inspect rsh
inspect rtsp
inspect esmtp
inspect sqlnet
inspect skinny
inspect sunrpc
inspect xdmcp
inspect sip
inspect netbios
inspect tftp
!
service-policy global_policy global
prompt hostname context
Cryptochecksum:b7394403dae8a4287cc382d406ab7f56
: end
pabelkid
20-07-2010, 10:02 AM
Hic! vẫn chưa có ai giúp.
Powered by vBulletin® Version 4.1.9 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.