標籤:des style blog http color io os ar 使用
一、一些廢話。
在高三的時候曾經接觸過Linux,被其帥氣的終端所打動,從此走上了和Linux鬥爭的道路,其中有辛酸,但更多的是快樂。剛開始之所以接觸Linux其實是因為BackTrack,然後學習了一些Linux下面的基本操作。最近這段時間想系統的學一下Linux安全方面的東西,準備把自己在這段時間當中的所學所想記錄下來,為折騰Linux的同學提供一些借鑒,當然如果你們看得上的話
二、SSH簡介。
簡單說,SSH是一種網路通訊協定,用於電腦之間的加密登入。
如果一個使用者從本機電腦,使用SSH協議登入另一台遠端電腦(多用於Linux之間),我們就可以認為,這種登入是安全的,即使被中途截獲,密碼也不會泄露。 (事實真的是這樣嗎?)
最早的時候,互連網通訊都是明文通訊,一旦被截獲,內容就暴露無疑。1995年,芬蘭學者Tatu Ylonen設計了SSH協議,將登入資訊全部加密,成為互連網安全的一個基本解決方案,迅速在全世界獲得推廣,目前已經成為Linux系統的標準配置。
需要指出的是,SSH只是一種協議,存在多種實現,既有商業實現,也有開源實現。本文針對的實現是OpenSSH,它是自由軟體,應用非常廣泛。
此外,本文只討論SSH在Linux Shell中的用法。如果要在Windows系統中使用SSH,會用到另一種軟體putty或者xshell之類。
三、簡單的使用方法。
1、如果你是Linux使用者,那麼很方面的:開啟終端,輸入:ssh [email protected]。其中websec為我的使用者名稱、192.168.61.132為主機地址。具體使用過程中替換相應使用者名稱和主機地址即可即可。接下來,斷行符號,這個時候輸入密碼再斷行符號就可以登入了。
2、如果你是windows使用者,那麼你需要使用類似xshell的東西去串連,具體過程不贅述,登入成功後如下:
三、ssh配置。
CenOS的ssh設定檔在:/etc/ssh/ssh_config
# $OpenBSD: ssh_config,v 1.25 2009/02/17 01:28:32 djm Exp $# This is the ssh client system-wide configuration file. See# ssh_config(5) for more information. This file provides defaults for# users, and the values can be changed in per-user configuration files# or on the command line.# Configuration data is parsed as follows:# 1. command line options# 2. user-specific file# 3. system-wide file# Any configuration value is only changed the first time it is set.# Thus, host-specific definitions should be at the beginning of the# configuration file, and defaults at the end.# Site-wide defaults for some commonly used options. For a comprehensive# list of available options, their meanings and defaults, please see the# ssh_config(5) man page.# Host *# ForwardAgent no# ForwardX11 no# RhostsRSAAuthentication no# RSAAuthentication yes# PasswordAuthentication yes# HostbasedAuthentication no# GSSAPIAuthentication no# GSSAPIDelegateCredentials no# GSSAPIKeyExchange no# GSSAPITrustDNS no# BatchMode no# CheckHostIP yes# AddressFamily any# ConnectTimeout 0# StrictHostKeyChecking ask# IdentityFile ~/.ssh/identity# IdentityFile ~/.ssh/id_rsa# IdentityFile ~/.ssh/id_dsa# Port 22# Protocol 2,1# Cipher 3des# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc# MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160# EscapeChar ~# Tunnel no# TunnelDevice any:any# PermitLocalCommand no# VisualHostKey noHost * GSSAPIAuthentication yes# If this option is set to yes then remote X11 clients will have full access# to the original X11 display. As virtually no X11 client supports the untrusted# mode correctly we set this to yes. ForwardX11Trusted yes# Send locale-related environment variables SendEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES SendEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT SendEnv LC_IDENTIFICATION LC_ALL LANGUAGE SendEnv XMODIFIERS
CentOS下ssh的配置