導航:首頁 > 程序命令 > secureshell命令

secureshell命令

發布時間:2023-01-05 18:43:38

1. 使用SSHSecureShellClient傳文件的步驟是什麼

SSH Secure Shell Client是SSH命令行控制終端,你應該是用SSH Secure File Transfer Client傳輸文件。
這里只談論他的使用方法,關於SSH配置你再找其他文章。
一、登陸方法
你可以在登陸的SSH Secure Shell Client里單擊工具欄里(或菜單)的New File Transfer Window,就直接登陸了。也可以單獨運行SSH Secure File Transfer Client。
登陸非常簡單,填寫Host Name(你的伺服器地址或域名),User Name(你的伺服器用戶名,注意你SSH使用root用戶是否有許可權登陸,或使用其他用戶登陸),Port(你SSH登陸的埠,默認為23)。
二、傳輸文件
一般默認的SSH Secure File Transfer Client界面左邊為你本地的磁碟信息,右邊的為登陸後伺服器的磁碟信息,確定需要傳到伺服器的文件,採用拖拽方法,也可以用滑鼠右健upload上傳。從伺服器中下載文件到本地,你也可以用拖拽方法,或用滑鼠右鍵Download下載。
三、注意事項
上傳下載,你需要注意用什麼方法上傳下載,用二進制還是ASCII還是自動,有些時候我們需要指定一下,要不上傳文件會有問題。
四、其他
SSH Secure File Transfer Client軟體應該沒有可選字元集utf8等,在有些linux里中文會出現亂碼,你可以用filezilla的sftp,因為filezilla可以選擇字元集,就不會有亂碼了。你也可以用其他工具參與你的伺服器配置。比如WinSCP,在改文件時特別有用,對於vi編輯器不太會用的是很好的替代工具。SecureCRT命令行控制終端可以選擇字元集等等。每個工具都有不同的優缺點,結合起來你在維護伺服器時才事倍功半。

2. ssh secure shell 如何使用

ssh埠是22 ssh是協議 是遠程登錄連接的協議 傳輸的數據加過密的
一般linux下用得多,一般linux vps都支持ssh登陸,window下可以用putty來連接ssh主機
host name 填寫你要連接的遠程主機IP
username 當然是連接遠程主機的登錄用戶
port 埠默認埠號是22
連接即可

Putty 隨著Linux在伺服器端應用的普及,Linux系統管理越來越依賴於遠程。在各種遠

程登錄工具中,Putty是 出色的工具之一。 Putty是一個免費的、Windows 32平台下的telnet、rlogin和ssh客戶端,但是功能絲毫不遜色於商業的telnet類工具。 用它來遠程管理Linux十分好用,其主要優點如下: ◆ 完全免費; ◆ 在Windows 9x/NT/2000下運行的都非常好; ◆ 全面支持ssh1和ssh2; ◆ 綠色軟體,無需安裝,下載後在桌面建個快捷方式即可使用; ◆ 體積很小,僅364KB (0.54 beta版本); ◆ 操作簡單,所有的操作都在一個控制面板中實現。編輯本段操作指南
使用簡介:
圖1 Putty配置界面
把Putty下載到機器上,雙擊putty.exe,就出現如圖1的配置界面。 選擇「Session」,在「Host Name (or IP address)」輸入框中輸入欲訪問的主機名或IP,比如server1或192.168.9.4。埠號(Port)根據使用的協議有所區別,ssh默認使用22,telnet默認使用23,rlogin默認使用513。 在「Protocol」單選欄中選擇使用的協議,一般是telnet或ssh,這取決於伺服器提供的服務。 在「Saved Session」輸入欄中輸入任務的名字,單擊「Save」按鈕,就可以把任務配置保存起來了。 配置完成後單擊「Open」按鈕,出現如圖2的登錄界面,就可以使用Putty連接Linux主機了。
圖2 使用Putty登錄界面
編輯本段常見問題
關於putty的一些使用中常見的問題 一、在Windows中使用putty登錄FreeBsd系統時,能夠輸入用戶名,但是輸入密碼後按回車鍵半天無反應 。 答:設置過程如下: 1. 在/etc/ssh/sshd_config中添加如下內容,使普通用戶可以通過SSH登錄: AllowUsers 普通用戶帳號 UseDNS no 2. 將希望使用su命令的用戶加入到wheel組中,在/etc/group中作如下修改 wheel:*:0:root,普通用戶帳號 二、在login as: 後輸入用戶名,[email protected]'s password: 游標不動。即使輸入正確的 密碼也是沒有反應? 答:這是因為putty不像telent那樣會直接顯示密碼,而是不顯示密碼,只要你輸入的密碼是正確的, 即使不顯示只要輸完密碼後直接回車即可進入,不用在乎游標不動。 當輸入密碼錯誤敲下回車時會出現 denice 以提示用戶密碼錯誤

3. iOS逆向工程(4)SSH免密碼連接iPhone

先摘抄一段簡單介紹:
安全外殼協議(SSH)是一種在不安全網路上提供安全遠程登錄及其它安全網路服務的協議。SecureShell,又可記為SSH,最初是UNIX系統上的一個程序,後來又迅速擴展到其他操作平台。

在我理解就是類似Windows 系統上面的Telnet,但是SSH相對於Telnet的一個重要優勢就是所有傳輸都是經過加密的。

在iOS中我們使用OpenSSH軟體。
OpenSSH原是一個在Linux下很實用的一個軟體。iPhone本身就是一個運行BSD系統(可認為是一種Liunx)的硬體,因此,Cydia的作者Saurik把OpenSSH這一軟體移植到了iOS平台上,並且簡化了安全認證密鑰的繁瑣,使之成為一款可以在iPhone上運行的Cydia插件。

在iOS的系統管理中,多半是使用命令行。在遠程管理中,多半是用OpenSSH通過Wi-Fi或者3G來對iPhone、iPad、iPod Touch執行命令修改文件等操作。

OpenSSH用途是在PC或者Mac上遠程輸入命令操作iOS設備,免去使用MobileTerminal,同時,也是一種在多系統下管理iPhone、iPad系統文件的方法。

連接到iPhone後可以執行各種UNIX命令,比如文件操作,拷貝刪除,等等很多用途。

如果沒有配置SSH免密碼連接,那麼我們在連接SSH的時候就會提示輸入密碼,每次都要輸入很麻煩,比如:

1,如果本人是做iOS開發的,項目用到了GIT版本控制,一般都配置SSH密鑰了。密鑰已經存在了電腦的./ssh目錄中,如果沒有配置,那麼可手動重新生成SSH密鑰,比如:
ssh-keygen -t rsa -b 4096 -C "[email protected]"

2,生成完成後,我們會在./ssh目錄中發現id_rsa.pub公鑰這個文件。
然後我們把它出來放到個人目錄下,並重命名,比如:
cp /Users/zhangdasen/.ssh/id_rsa.pub ~/authorized_keys

3,我們手動SSH進入設備中,或者通過PP助手進入設備中,查看是否存在var/root/.ssh目錄,如果沒有,我們手動創建下。可通過SSH連接後mkdir創建,或者PP助手連接後創建。

4,創建後我們把authorized_keys拷貝到設備中,可利用SCP命令:
scp ~/authorized_keys [email protected]:/var/root/.ssh

5,然後按正常我們就可以直接SSH連接的時候不用輸入密碼了,如圖:

6,這個時候,如果我們使用tweak打包時候,也不會再讓我們輸入SSH密碼了。

下一篇: iOS逆向工程(8) 一條命令砸殼(詳細菜鳥版)

4. 怎樣在SecureCRT的shell里用命令上傳下載文件(轉)

SecureCRT記住密碼的功能容易設置,於是偶這懶人,後來習慣了用SecureCRT,但其上傳文件功能偶一直沒弄明白過。之前一直用的是pshell,因為pshell有個功能強大的secureftp功能,打開之後,直接將目錄或文件拖到此窗口即可。SecureCRT卻沒有那麼方便。 1.在shell里直接使用命令 首先最好設置好本地與遠程主機傳輸文件的目錄,因為使用命令下載文件時是不會提示選擇下載的目標目錄的。 設置方法:本地目錄在 選項-》會話選項-》SFTP標簽 的本地目錄里設置。 目錄設置好之後就可以使用命令上傳和下載文件了 上傳命令:rz rz輸入後SecureCRT會打開一個文件選擇對話框,供用戶選擇需上傳的文件 下載命令:sz 可用sz -h 查看sz更多選項 用法很簡單,但是可惜,使用這兩命令不能傳輸目錄,只能是文件。 2.使用SecureCRT的SFTP功能 在已連接的遠程主機標簽上點擊右鍵選擇連接SFTP標簽頁即可建立SFTP的連接,這是一個使用命令的連接會話不提供圖形界面。 目錄轉換:遠程主機上: 可以使用所有shell中的目錄和文件操作命令:ls,pwd,cd等等來對 遠程主機上的目錄進行更改操作,不能使用vi等文件編輯工具 本地主機上:對本地目錄進行操作需在以上命令前加上"l",即 ls-》lls,pwd-》lpwd,cd-》lcd文件傳輸上傳文件: put file 上傳目錄:put -r dir 下載文件: get file 下載目錄:get -r dir 註:這里file可以使用*等通配符 如果是通過通道機登錄的某遠程主機,則SFTP就不可用了。例如通過10.10.20.124登錄的60.25.21.148,操作是在60.25.21.148上,直接右鍵建立SFTP連接是建立不起來的,因此只能使用上面的sz和rz的命令操作。

5. ssh secure shell 的命令是用什麼語言的,我是新手,剛入門

ssh secure shell 只是一個網路工具,不是什麼語言。
SSH(Secure Shell)是一種通用的、功能強大的、基於軟體的網路安全解決方案。計算機每次向網路發送數據時,SSH都會自動對其進行加密。數據到達目的地時,SSH自動對加密數據進行解密。整個過程都是透明的,使用OpenSSH工具將會增進你的系統安全性。 談到網路安全訪問,相信大家首先想到的就是安全Shell,也就是Secure Shell,通常簡寫為SSH。這是因為SSH安裝容易、使用簡單,而且比較常見,一般的Unix系統、Linux系統、FreeBSD系統都附帶有支持SSH的應用程序包。

6. ssh secure shell client怎麼使用

1.通常情況下開發的web系統在apache + tomcat Linux環境中測試,使用客戶端操作工具:SSH Secure Shell
首先是安裝:SSHSecureShellClient-3.2.9.exe
安裝完成後,打開Secure Shell Client -> Quick Connect
Host Name: 192.168.0.23
User Name: root
Port 22
Authentication <Profile Settings> 默認值
Connect -> Enter your Password -> OK
命令行界面定位到:[root@localhost root]#
同理打開:Secure File Transfer Client,用於文件傳輸。

2.目錄結構(圖形界面)
Xml代碼
/
...
usr
apache2
...
conf
...
httpd.conf
bin
...
apachectl
tomcat5
...
conf
...
server.xml
bin
...
shutdown.sh
startup.sh
webapps
...
eWebEditor

3.命令界面
cd /usr/tomcat5/bin 轉入到tomcat5 bin文件夾
./shutdown.sh 關閉tomcat服務
./startup.sh 啟動tomcat服務
cd /usr/apache2/bin 轉入到apache2 bin文件夾
./apachectl start|stop|restart|graceful 啟動|關閉|重啟|優化apache服務
ls 查看目錄文件命令
move 文件夾 .. 移動文件夾到上一目錄
rm -rf eWebEditor/ 刪除文件夾eWebEditor
ps -ef|grep java 查看tomcat啟動進程信息,進程ID
kill -9 進程ID 強制關閉tomcat服務進程
緩存清理
/usr/tomcat5/work/Catalina/eWebEditor 直接刪掉eWebEditor文件夾清理緩存

4.配置文件
1./usr/tomcat5/conf 修改server.xml
增加一個Host節點 如下:
Xml代碼
<Host name="eWebEditor.7234.com.cn"
debug="0"
appBase=""
unpackWARs="true"
autoDeploy="true">
<Context path=""
docBase="/usr/webapps/eWebEditor/"
debug="0"
privileged="true"
reloadable="true"/>
</Host>

2./usr/apache2/conf 修改httpd.conf
增加一個VirtualHost節點 如下:
Xml代碼
<VirtualHost *>
<LocationMatch "/WEB-INF/">
AllowOverride None
deny from all
</LocationMatch>

<LocationMatch "/META-INF/">
AllowOverride None
deny from all
</LocationMatch>

RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
Rewriterule .* - [F]

ServerAdmin [email protected]
DocumentRoot /usr/webapps/eWebEditor/
ServerName eWebEditor.7234.com.cn
ErrorLog logs/eWebEditor.7234.com.cn-error_log
CustomLog "|/usr/local/sbin/cronolog /usr/logs/apache_logs/eWebEditor.7234.com.cn_access_log.%Y%m%d" combined
</VirtualHost>

5.本地hosts配置:C:\WINDOWS\system32\drivers\etc\hosts
192.168.0.23 eWebEditor.7234.com.cn

6.拼是否成功:開始->運行->cmd
ping eWebEditor.7234.com.cn
#查看域名對應的IP地址:是內網還是外網的方法或是否連接成功。

7.最後在瀏覽器中輸入:http://ewebeditor.7234.com.cn/ 請求頁面,查看頁面顯示效果。

備註:eWebEditor或eWebEditor.7234.com.cn或紅色字體部分為變數,在實際使用過程中修改過來,本文以eWebEditor工程為例。

7. 華為交換機命令大全

aaa 解釋AAA

acl 解釋 Specify ACL configuration information

alarm解釋 Enter the alarm view

anti-attack 解釋 Specify anti-attack configurations

application-apperceive 解釋 Set application-apperceive information

arp 解釋 ARP mole

arp-miss 解釋 Specify ARP MISS configuration information

arp-suppress 解釋 Specify arp suppress configuration information, default is disabled

authentication 解釋 Authentication

autoconfig 解釋 AutoConfig configuration information

bfd 解釋 Specify BFD(Bidirectional Forwarding Detection)configuration information

bgp 解釋 Border Gateway Protocol(BGP)

bootrom 解釋 BootRom

bp 解釋 BPDU message

btv 解釋 Btv view

bulk-file 解釋 Specify the file name of bulk statistics

bulk-stat 解釋 Set bulk statistics

capture-packet 解釋 Capture-packet

ccc 解釋 Circuit cross connection

cfm 解釋 Connectivity fault management

clear 解釋 Cancel current configuration

cluster 解釋 Specify the information for cluster configuration

command-privilege 解釋 Specify the command level

cp-car 解釋 Cpu car setting

cpu-defend 解釋 Configure CPU defend policy

cpu-defend-policy 解釋 Configure CPU defend policy

cpu-usage 解釋 Set cpu usage configuration

dhcp 解釋 Dynamic host configure protocol

dhcp-snooping 解釋 DHCP snooping

dhcpv6 解釋 DHCPv6

diffserv 解釋 Specify diffserv parameters

display 解釋 Display priority information

dldp 解釋 Device link detection protocol

dns 解釋 Specify domain name system

domain 解釋 Default domain

dot1x 解釋 802.1x configuration information

drop 解釋 Discard attribute

drop-profile 解釋 Drop profile

dsa 解釋 Specify DSA mole configurations

e-trunk 解釋 E-Trunk

ecmp 解釋 ECMP

efm 解釋 EFM mole

erps 解釋 Ethernet ring protection switching

error-down 解釋 The interface was shut down because of an error event

event 解釋 Enter the event view

execute 解釋 Batch command

fib 解釋 FIB status and configuration information

file 解釋 Specify file system configuration information

ftp 解釋 Set the FTP server attributes

garp 解釋 Generic Attribute Registration Protocol

gtsm 解釋 The generalized TTL security mechanism

gvrp 解釋 Generic VLAN Registration Protocol

header 解釋 Define the login banner

hwtacacs 解釋

hwtacacs-server 解釋

icmp 解釋 Specify ICMP configuration information

icmp-reply 解釋 Enable ICMP reply fast

igmp 解釋 Specify IGMP configuration information

igmp-snooping 解釋 Specify parameters for IGMP-Snooping

info-center 解釋 Specify message output configuration information

interface 解釋 Specify the interface configuration view

ip 解釋 Specify IP configurations for the system

ipv4 解釋 Configure ip packet

ipv6 解釋 Enable IPv6 functionality

isis 解釋 Intermediate System to Intermediate System (ISIS) routes

keychain 解釋 Keychain authentication

l2-topology 解釋 Layer 2 topology

l2protocol-tunnel 解釋 Layer 2 protocol tunnel

lacp 解釋 Link aggregation control protocol

lldp 解釋 Link Layer Discovery Protocol

load-balance 解釋 Specify load balance mode

loopback-detect 解釋 Loopback detect function

lspv 解釋 Lsp verification

mac-address 解釋 Mac address

mac-authen 解釋 MAC authenticate configure information

mac-forced-forwarding 解釋 Mac-Forced Forwarding

mac-learning 解釋 MAC learning

mac-spoofing-defend 解釋 MAC spoofing defend

matched 解釋 Is Command can be matched by upper template

mip解釋 Configure a rule used to create MIP

mld-snooping 解釋 Specify parameters for MLD-Snooping

monitor-link 解釋 Monitor link configuration information

mpls 解釋 Specify MPLS(Multiprotocol Label Switching) configuration information

mpls-qos 解釋 MPLS QoS

msdp 解釋 Specify MSDP(Multicast Source Discovery Protocol) configuration information

mtrace 解釋 Trace route to multicast source

multicast 解釋 Multicast information

nap 解釋 NAP protocol

nd 解釋 Neighbor discovery

ndp 解釋 Neighbor discovery protocol

nqa 解釋 Network Quality Analysis(NQA)

nqa-jitter 解釋 Switch NQA jitter version

nqa-server 解釋 Specify NQA echo server

ntdp 解釋 Network topology discovery protocol

ntp-service 解釋 Specify NTP (Network Time Protocol) configuration information

oam-mgr 解釋 Oam-mgr view

observe-port 解釋 Configure observe port feature

ospf 解釋 Open Shortest Path First (OSPF)

ospfv3解釋 OSPF version 3 for IPv6

pim 解釋 Specify PIM(Protocol Independent Multicast) configuration information

ping 解釋 Ping function

policy-based-route 解釋 Specify a policy for policy based routing

port-group 解釋 Port-group

port-isolate 解釋 Port isolate

port-mirroring 解釋 Mirror port

portal 解釋 Configure Portal local server

portswitch 解釋 Switch port between router and switch mode

pppoe 解釋 PPPOE

pw-template 解釋 Specify PW template configuration

qos 解釋 QoS configuration

quit 解釋 Exit from current command view

radius-server 解釋 Add or delete RADIUS server template

refresh 解釋 Refresh routes to I/O board

reset 解釋 Reset operation

return 解釋 Exit to user view

rip 解釋 RIP (Routing Information Protocol)

ripng 解釋 RIPng (Routing information next generation protocol)

rmon 解釋 Specify RMON configuration

rmon2 解釋 Specify RMON2 configuration

route 解釋 Routing Mole

route-policy 解釋 Route-policy

route-policy-change 解釋 Specify route policy change parameter

router 解釋 Configure router information

rrpp 解釋 Rapid ring protection protocol

rsa 解釋 Specify RSA mole configuration information

scp 解釋 Set SCP server

screen-width 解釋 Set screen width

script-string 解釋 Define a modem script-string

sep 解釋 Smart ethernet protection

service 解釋 Toggle service mode. By default it is off

set 解釋 Set

sftp 解釋 Set SFTP service attribute

smart-link 解釋 Smart link configuration information

snmp-agent 解釋 Specify SNMP (Simple Network Management Protocol) configuration information

ssh 解釋 Set the SSH (secure shell) configuration attribute

stack 解釋 Stack

static-lsp 解釋 Static LSP configuration

stelnet 解釋 Set Stelnet service attribute

stp 解釋 Specify Spanning Tree Protocol (STP) configuration information

super 解釋 Modify super password parameters

sysname 解釋 Specify the host name

tcp 解釋 Specify TCP(Transmission Control Protocol) configuration information

telnet 解釋 Set the status of the Telnet service

temperature 解釋 Device temperature

test-aaa 解釋 Accounts test

test-packet 解釋 Set the test packet

tftp 解釋 Establish a TFTP connection

tftp-server 解釋 TFTP server

time-range 解釋 Specify time-range configuration information

trace 解釋 Trace route (switch) to host on Data Link Layer

tracert 解釋 Trace route to host

traffic 解釋 Specify traffic configuration information

traffic-delete 解釋 Delete sacl

traffic-filter 解釋 Filter packets based on acl

traffic-limit 解釋 Limit the rate of the packets based on acl

traffic-mirror 解釋 Mirror packets based on acl

traffic-policy 解釋 Apply specific traffic policy

traffic-redirect 解釋 Redirect packets based on acl

traffic-remark 解釋 Remark packets based on acl

traffic-statistic 解釋 Count packets based on acl

trunk 解釋 Trunk interface

ttl 解釋 Time to live

tunnel-selector 解釋 Tunnel-policy selector

udp-helper 解釋 UDP Helper

undo 解釋 Cancel current configuration

unknown-unicast 解釋 Unknown unicast

upgrade 解釋 Upgrade software online

user-bind 解釋 User bind

user-group 解釋 User group

user-interface 解釋 Configure the user terminal interface

vlan 解釋 Virtual LAN

voice-vlan 解釋 Voice VLAN

vrrp 解釋 Specify configuration information about VRRP

web-auth-server 解釋 Portal authentication server

8. CentOS7 sshd

http://blog.csdn.net/capricorn90/article/details/52578856

實驗環境:CentOS7 Minimal安裝,安裝過程及軟體包見 http://blog.csdn.net/capricorn90/article/details/52556174
SSH的英文全稱是Secure SHell。通過使用SSH,你可以把所有傳輸的數據進行加密,這樣「中間人」這種攻擊方式就不可能實現了,而且也能夠防止DNS和IP欺騙。還有一個額外的好處就是傳輸的數據是經過壓縮的,所以可以加快傳輸的速度。SSH有很多功能,它既可以代替telnet,又可以為ftp、pop、甚至ppp提供一個安全的「通道」。

SSH在Linux中的服務是sshd,安裝openssh後才可開啟。CentOS 7 安裝後默認情況下是不啟動sshd服務,即無法通過ssh服務遠程連接。
首先查看系統是否安裝openssh,一般情況想都是默認安裝了,

如果沒有安裝可以通過yum在線安裝。

簡單的設置就是在命令行中啟動sshd服務。這樣做比較快捷直接,但是只能對當前狀態有效,一旦重啟系統就丟失了該服務。

通過systemctl命令可以將sshd服務加到開機自啟動列表裡。實現開機自動啟動sshd服務。

在sshd_config文件中存放了埠、控制策略等信息。

首先修改埠,埠設置為自定義埠,即1024之後的埠,這里設置為8090。

禁止空密碼用戶登錄。

開啟密碼登錄授權(默認即開啟)

禁止root賬戶使用ssh登錄,這種設置通常用於互聯網伺服器,防止提權後用root賬戶登錄搞破壞。

注意其中關於port的提示文字

修改埠的時候需要添加到防火牆的控制中,否則無法使用ssh連接。

semanage只是埠工具,修改防火牆只能使用firewall-cmd

9. Linux shell常用命令

Linux shell常用命令匯總

對於經常使用linux系統的博主來說,基本常用的shell命令是少不了的,下面為大家總結了Linux shell的常用命令,希望對大家有所幫助!

1.檢查遠程埠是否對bash開放:

echo >/dev/tcp/8.8.8.8/53 && echo "open"

2.讓進程轉入後台:

Ctrl + z

3、將進程轉到前台:

fg

4.產生隨機的十六進制數,其中n是字元數:

openssl rand -hex n

5.在當前shell里執行一個文件里的命令:

source /home/user/file.name

6.截取前5個字元:

${variable:0:5}

7.SSH debug 模式:

ssh -vvv user@ip_address

8.SSH with pem key:

ssh user@ip_address -i key.pem

9.用wget抓取完整的網站目錄結構,存放到本地目錄中:

wget -r --no-parent --reject "index.html*" http://hostname/ -P /home/user/dirs

10.一次創建多個目錄:

mkdir -p /home/user/{test,test1,test2}

11.列出包括子進程的進程樹:

ps axwef

12.創建 war 文件:

jar -cvf name.war file

13.測試硬碟寫入速度:

dd if=/dev/zero of=/tmp/output.img bs=8k count=256k; rm -rf /tmp/output.img

14.測試硬碟讀取速度:

hdparm -Tt /dev/sda

15.獲取文本的md5 hash:

echo -n "text" | md5sum

16.檢查xml格式:

xmllint --noout file.xml

17.將tar.gz提取到新目錄里:

tar zxvf package.tar.gz -C new_dir

18.使用curl獲取HTTP頭信息:

curl -I http://www.example.com

19.修改文件或目錄的時間戳(YYMMDDhhmm):

touch -t 0712250000 file

20.用wget命令執行ftp下載:

wget -m ftp://username:password@hostname

21.生成隨機密碼(例子里是16個字元長):

LANG=c < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-16};echo;

22.快速備份一個文件:

cp some_file_name{,.bkp}

23.訪問Windows共享目錄:

smbclient -U "DOMAIN\user" //dc.domain.com/share/test/dir

24.執行歷史記錄里的命令(這里是第100行):

!100

25.解壓:

unzip package_name.zip -d dir_name

26.輸入多行文字(CTRL + d 退出):

cat > test.txt

27.創建空文件或清空一個現有文件:

\> test.txt

28.與Ubuntu NTP server同步時間:

ntpdate ntp.ubuntu.com

29.用netstat顯示所有tcp4監聽埠:

netstat -lnt4 | awk '{print $4}' | cut -f2 -d: | grep -o '[0-9]*'

30.qcow2鏡像文件轉換:

qemu-img convert -f qcow2 -O raw precise-server-cloudimg-amd64-disk1.img \precise-server-cloudimg-amd64-disk1.raw

31.重復運行文件,顯示其輸出(預設是2秒一次):

watch ps -ef

32.所有用戶列表:

getent passwd

33.Mount root in read/write mode:

mount -o remount,rw /

34.掛載一個目錄(這是不能使用鏈接的情況):

mount --bind /source /destination

35.動態更新DNS server:

nsupdate < <eof p=""> </eof>

update add $HOST 86400 A $IP

send

EOF

36.遞歸grep所有目錄:

grep -r "some_text" /path/to/dir

37.列出前10個最大的文件:

lsof / | awk '{ if($7 > 1048576) print $7/1048576 "MB "$9 }' | sort -n -u | tail

39.打開Vim並跳到文件末:

vim + some_file_name

40.Git 克隆指定分支(master):

git clone [email protected]:name/app.git -b master

41.Git 切換到其它分支(develop):

git checkout develop

42.Git 刪除分支(myfeature):

git branch -d myfeature

43.Git 刪除遠程分支

git push origin :branchName

44.Git 將新分支推送到遠程伺服器:

git push -u origin mynewfeature

45.列印歷史記錄中最後一次cat命令:

!cat:p

46.運行歷史記錄里最後一次cat命令:

!cat

47.找出/home/user下所有空子目錄:

echo >/dev/tcp/8.8.8.8/53 && echo "open"

1.檢查遠程埠是否對bash開放:

find /home/user -maxdepth 1 -type d -empty

48.獲取test.txt文件中第50-60行內容:

< test.txt sed -n '50,60p'

49.運行最後一個命令(如果最後一個命令是mkdir /root/test, 下面將會運行: sudo mkdir /root/test):

sudo !!

50.創建臨時RAM文件系統 – ramdisk (先創建/tmpram目錄):

mount -t tmpfs tmpfs /tmpram -o size=512m

51.Grep whole words:

grep -w "name" test.txt

52.在需要提升許可權的.情況下往一個文件里追加文本:

echo "some text" | sudo tee -a /path/file

53.列出所有kill signal參數:

kill -l

54.在bash歷史記錄里禁止記錄最後一次會話:

kill -9 $$

55.掃描網路尋找開放的埠:

nmap -p 8081 172.20.0.0/16

56.設置git email:

git config --global user.email "[email protected]"

57.To sync with master if you have unpublished commits:

git pull --rebase origin master

58.將所有文件名中含有”txt”的文件移入/home/user目錄:

find -iname "*txt*" -exec mv -v {} /home/user \;

59.將文件按行並列顯示:

paste test.txt test1.txt

60.shell里的進度條:

pv data.log

61.使用netcat將數據發送到Graphite server:

echo "hosts.sampleHost 10 `date +%s`" | nc 192.168.200.2 3000

62.將tabs轉換成空格:

expand test.txt > test1.txt

63.Skip bash history:

< space >cmd

64.去之前的工作目錄:

cd -

65.拆分大體積的tar.gz文件(每個100MB),然後合並回去:

split –b 100m /path/to/large/archive /path/to/output/files

cat files* > archive

66.使用curl獲取HTTP status code:

curl -sL -w "%{http_code}\\n" www.example.com -o /dev/null

67.設置root密碼,強化MySQL安全安裝:

/usr/bin/mysql_secure_installation

68.當Ctrl + c不好使時:

Ctrl + \

69.獲取文件owner:

stat -c %U file.txt

70.block設備列表:

lsblk -f

71.找出文件名結尾有空格的文件:

find . -type f -exec egrep -l " +$" {} \;

72.找出文件名有tab縮進符的文件

find . -type f -exec egrep -l $'\t' {} \;

73.用”=”列印出橫線:全選復制放進筆記

printf '%100s\n' | tr ' ' = ;

閱讀全文

與secureshell命令相關的資料

熱點內容
dvd光碟存儲漢子演算法 瀏覽:757
蘋果郵件無法連接伺服器地址 瀏覽:962
phpffmpeg轉碼 瀏覽:671
長沙好玩的解壓項目 瀏覽:144
專屬學情分析報告是什麼app 瀏覽:564
php工程部署 瀏覽:833
android全屏透明 瀏覽:736
阿里雲伺服器已開通怎麼辦 瀏覽:803
光遇為什麼登錄時伺服器已滿 瀏覽:302
PDF分析 瀏覽:484
h3c光纖全工半全工設置命令 瀏覽:143
公司法pdf下載 瀏覽:381
linuxmarkdown 瀏覽:350
華為手機怎麼多選文件夾 瀏覽:683
如何取消命令方塊指令 瀏覽:349
風翼app為什麼進不去了 瀏覽:778
im4java壓縮圖片 瀏覽:362
數據查詢網站源碼 瀏覽:150
伊克塞爾文檔怎麼進行加密 瀏覽:892
app轉賬是什麼 瀏覽:163