SSH operation parsing under Linux

Source: Internet
Author: User

1. Check the SSH status:

Service sshd Status

See if SSH has been started and some status information

2. Start the SSH service:
Systemctl Restart Sshd.service

Some of the basic services under Ps:fedora are controlled by Systemctl Restart/stop Xxx.service operations, such as Apache servers: Httpd.service, Firewall service Firewalld.service, and so on.

3.SSH configuration file path:
/etc/ssh/sshd_config. Configure port numbers, permissions, and other information for SSH connections

4. Turn off the firewall
Systemctl Disable Firewalld.service

It is not appropriate to close the firewall entirely, and it is better to use the following command:

5. Add Port 22 (or other custom ports) to the firewall's settings and mark it as accept
Iptables-a input-p TCP--dport 22-j ACCEPT

View the configuration file for SSH to see that the default port number is 22, so unblock it at the firewall

6. Firewall configuration file path:
/etc/sysconfig/iptables

Some basic operations of the SSH component:

Log on to the remote server first:

SSH [email protected]

User represents the username of the remote server, where a password is required.


Using SCP for file operations:

File upload: scp-r/home/xxx [Email protected]:/home/xxx

File download: And the file upload path to swap is OK.


File upload and download using SFTP:

SFTP and FTP tools operate similarly to facilitate the management of directory resources.

Login:

Format:sftp-oport=<port> <user>@The


After the SFTP connection is successful, the common operation commands are as follows:
help/? Print help information.

PWD View the current directory of the remote server;

Lpwd view the current directory of the Local system.

CD <dir> Change the current directory of the remote server to <dir>

LCD <dir> Change the current directory of the local system to <dir>.

LS Displays the file name of the current directory on the remote server;

LS-L displays a detailed list of files for the current directory on the remote server

LS <pattern> Displays the file name that matches the specified mode <pattern> on the remote server;

Ls-l <pattern> Displays a detailed list of files on the remote server that match the specified mode <pattern>.

LLS Displays the file name of the current directory on the local system;

The other parameters of the lls are similar to the LS command.

Get <file> download specified file <file>;
Get <pattern> download files that match the specified mode <pattern>.
Put <file> upload specified file <file>;
Get <pattern> upload files that match the specified mode <pattern>.
Progress toggles whether the file transfer progress is displayed.
mkdir <dir> Create a directory on a remote server;
Lmkdir <dir> Create a directory on the local system.
Exit/quit/bye exit sftp.
! Start a local shell.
! <commandline> executes the local command line.
Other commands are: Chgrp, chmod, chown, Ln, lumask, rename, rm, RmDir, Symlink, version.

Remember: There is an ' l ' in front of the local file operation in SFTP mode


end~




SSH operation parsing under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.