当前位置:网站首页>Summary of common SSH commands
Summary of common SSH commands
2022-06-24 03:30:00 【Introductory notes】
Secure Shell The abbreviation is SSH, from IETF Network working group of (Network Working Group) Established by ,SSH It is a security protocol based on application layer and transport layer , For the computer's shell Provide a secure transport and use environment .
It is easy to use
The simplest use is without parameters .
> ssh rumenz.com [email protected]'s password:
Log in to the host in this form , The current user will be used for login by default . For the first time ,SSH Will confirm the authenticity of the target host , If there is no problem , Input yes that will do .
Specify the user name to log in
Method 1
> ssh -l rumenz rumenz.com
Method 2
> ssh [email protected]
Method 2 is more commonly used
Specify port login
SSH The default port number is 22. Most modern Linux System 22 Ports are all open . If you run ssh Program without specifying a port number , It's directly through 22 The port sends the request .
If we don't want to pass 22 Port login , Then we can use -p Option to specify the port .
> ssh [email protected] -p 1234
modify SSH Default port for
Only need to modify /etc/ssh/ssh_config , Change the following line :
> vim /etc/ssh/ssh_config Port 1234 // restart ssh > systemctl restart sshd.service
Request compression for all data
Use -C Options , All through SSH Data sent or received will be compressed , And still encrypted .
> ssh -C [email protected]
however , This option is useful when the network speed is not very fast , And when the network speed is fast , Using compression will reduce efficiency , So use it as appropriate .
Turn on debug mode
For some reason , We want to track and debug the SSH Connection .SSH Provided -v This is why the option parameters are set . It can see in which link there is a problem .
> ssh -v [email protected] OpenSSH_7.9p1, LibreSSL 2.7.3 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 48: Applying options for * debug1: Connecting to rumenz.com port 22. debug1: Connection established. debug1: identity file /Users/mac/.ssh/id_rsa type 0 debug1: identity file /Users/mac/.ssh/id_rsa-cert type -1 debug1: identity file /Users/mac/.ssh/id_dsa type -1 debug1: identity file /Users/mac/.ssh/id_dsa-cert type -1 debug1: identity file /Users/mac/.ssh/id_ecdsa type -1 debug1: identity file /Users/mac/.ssh/id_ecdsa-cert type -1 debug1: identity file /Users/mac/.ssh/id_ed25519 type -1 debug1: identity file /Users/mac/.ssh/id_ed25519-cert type -1 debug1: identity file /Users/mac/.ssh/id_xmss type -1 debug1: identity file /Users/mac/.ssh/id_xmss-cert type -1 ...
Bind source address
If a computer or server has multiple network cards , Then there may be more than one ip, You can't tell which one you're using IP Connect to SSH The server . To solve this situation , We can use -b Option to specify a IP Address . This IP Will be used as the source address to establish the connection .
> ssh -b 1.2.3.4 [email protected]
Remote execution command
If we just want to execute a command remotely , You can just follow the command directly
> ssh [email protected] ls -l
Mount remote file system
sshfs It allows you to mount the file system of the remote host directly locally . Its usage format is as follows :
> sshfs -o idmap=user [email protected]:/home/user ~/Remote
This command can send the remote host pi Mount the user's home directory to the local home directory
rumenzFolder .
> sshfs -o idmap=user [email protected]:/home/pi ~/rumenz
Link to the original text :https://rumenz.com/rumenbiji/ssh-common-commands.html
WeChat official account : Entry station
边栏推荐
- What is the difference between elasticity and scalability of cloud computing? What does elastic scaling of cloud computing mean?
- Grp: how to gracefully shutdown a process?
- Sinclair radio stopped broadcasting many TV stations, suspected of being attacked by blackmail software
- Chapter 4: LED flash case of PS bare metal and FreeRTOS case development
- JMeter uses JDBC to perform database pressure test
- LeetCode 129. Find the sum of numbers from root node to leaf node
- Liaoyuan social cloud primary actual combat camp test environment script
- If the cloud knows that security is important
- Tencent cloud launched its new 100g+ cloud server product!! Expect more than 400g+ in the future!
- How does the fortress machine connect to the server? Which is easy to use, fortress machine or firewall?
猜你喜欢
![[summary of interview questions] zj6 redis](/img/4b/eadf66ca8d834f049f3546d348fa32.jpg)
[summary of interview questions] zj6 redis

Simple and beautiful weather code

Ar 3D map technology

Sorting out of key vulnerabilities identified by CMS in the peripheral management of red team (I)
![[summary of interview questions] zj5](/img/d8/ece82f8b2479adb948ba706f6f5039.jpg)
[summary of interview questions] zj5

QT creator tips

On Sunday, I rolled up the uni app "uview excellent UI framework"

Get to know MySQL database

Community pycharm installation visual database
随机推荐
13. Tencent cloud IOT device side learning - data template function and Implementation
How to register a trademark? Is the process troublesome?
The server size of the cloud desktop. The cloud desktop faces the server configuration requirements
Double 11 will arrive soon. Is your website ready?
Which domestic cloud desktop server is good? What are the security guarantees for cloud desktop servers?
How to solve the problem of easycvr playing the total recording time in the specified time period?
Industrial security experts talk about how to build security protection capability for government big data platform?
How does the fortress machine connect to the server? Which is easy to use, fortress machine or firewall?
The medical technology giant was blackmailed and Microsoft announced 74 security vulnerabilities | global network security hotspot
Shopee Clickhouse cold and hot data separation storage architecture and Practice
Grpc: how to make grpc provide restful API services?
What is the price of the elastic public network IP bandwidth
TRTC audio quality problem
golang with script
What technology does cloud computing elasticity scale? What are the advantages of elastic scaling in cloud computing?
Is the cloud desktop server highly required for installation and configuration? Is cloud desktop easy to use?
Tens of millions of Android infected with malicious virus and Microsoft disabled a function of Excel | global network security hotspot on October 9
Principle of efficient animation Implementation-A preliminary exploration of jetpack compose
What aspects does the intelligent identification system include? Is the technology of intelligent identification system mature now?
[hot] with a budget of only 100 yuan, how to build a 1-year web site on Tencent cloud??