Ubuntu SSH connection, remote upload download file
Blog Category:
Installing the SSH (Secure Shell) service to provide remote management services
sudo apt-get install SSH
SSH Remote Login Ubuntu Machine
SSH [email protected]
Copy files/folders from a remote Ubuntu machine to a local (SCP)
scp-r [email protected]:/home/username/remotefile.txt.
Copy files/folders from local to the remote Ubuntu machine (SCP)
Scp-r localfile.txt [Email protected]:/home/username/
Copy files/folders from a remote Ubuntu machine to local (rsync)
Rsync-v-u-a--delete--rsh=ssh--stats [email protected]:/home/username/remotefile.txt.
Copy files/folders from local to the remote Ubuntu machine (rsync)
Rsync-v-u-a--delete--rsh=ssh--stats localfile.txt [email protected]:/home/username/
Telnet to an Ubuntu machine on a Windows machine with SSH
Download PuTTY
How to copy files/folders from/To a remote Ubuntu machine on a Windows machine
Download FileZilla
ssh-x [email protected]
Support SSH GUI. In other words, gedit Open and save are operating on the server side. Nautilus Open the server-side file manager. This is much more convenient than just using the command line. Do not know the Putty support under Windows does not.
ssh-x [email protected] ls
Executes the LS return result directly on the server side to the client
How to restrict user accounts that are connected remotely via SSH
For example, if you enable the SSH service, any user with a valid account can connect remotely. This may lead to some security issues because some remote password cracking tools can try common username/password
Backing up the configuration file for the SSH service
sudo cp/etc/ssh/sshd_config/etc/ssh/sshd_config. ORIGINAL
Editing a configuration file
sudo gedit/etc/ssh/sshd_config
* Change the parameter permitrootlogin from Yes to No. The superuser cannot be directly online through the remote.
* Add parameter Allowusers set the user name of the remote connection (separated by a space).
* You can also use denyusers for fine-grained selection of users.
* If you enable the OpenSSH server and you has no intention for now to enable remote connections, you may add allowusers Nosuchuserhere to disable anyone connecting.
SSH command
The SSH command can be used to execute commands on a remote machine without a shell prompt to log on. Its syntax format is: SSH hostname command. For example, if you want to execute the ls/usr/share/doc command on the remote host penguin.example.net, type the following command at the shell prompt:
SSH penguin.example.net Ls/usr/share/doc
3.2. Using the SCP command
The SCP command can be used to transfer files between machines through secure, encrypted connections. It is similar to RCP.
The general syntax for transferring local files to a remote system is:
SCP LocalFile [Email protected]:/newfilename
LocalFile Specify the source file, [email protected]:/newfilename Specify the destination file.
To transfer the local file Shadowman to your account on Penguin.example.net, type (replace the username with your username) at the shell prompt:
SCP Shadowman [Email protected]:/home/username
This will transfer the local file Shadowman to the/home/username/shadowman file on Penguin.example.net.
The general syntax for transferring remote files to the local system is:
SCP [Email Protected]:/remotefile/newlocalfile
REMOTEFILE Specifies the source file, Newlocalfile specifies the destination file.
The source file can consist of multiple files. For example, to transfer the contents of the directory/downloads to the existing uploads directory on the remote machine penguin.example.net, type the following command at the shell prompt:
scp/downloads/* [Email protected]:/uploads/
3.3. Using the SFTP command
The SFTP tool can be used to open a secure interactive FTP session. It is similar to FTP, except that it uses a secure, encrypted connection. Its general syntax is: sftp [email protected]. Once verified, you can use a set of commands similar to those used by FTP. Please refer to the SFTP manual page (man) for a list of these commands. To read the instructions page, execute the man sftp command at the shell prompt. The SFTP tool is only available for OpenSSH version 2.5.0p1.
SSH concept
SSH means that the secure SHELL,SSH protocol family is developed by the network Working Group of the IETF (Internet Engineering Task force), The SSH protocol is a security protocol based on the application layer and the transport layer.
Traditional Web services, such as FTP, pop, and telnet, are inherently insecure because they transmit data, user accounts, and user passwords in clear text over the network, and are vulnerable to an attack by a man-in-the-middle (man-in-the-middle) attack. Is that there is another person or a machine impersonating a real server to receive data from a user to the server, and then impersonating the user to pass the data to the real server.
SSH (Secure Shell) is the most reliable protocol to provide security for Telnet sessions and other network services at the moment. The use of SSH protocol can effectively prevent the information leakage in the remote management process. With SSH, all transmitted data can be encrypted, as well as prevent DNS spoofing and IP spoofing.
An additional benefit of SSH is that the transmitted data is compressed so that the transfer speed can be speeded up. SSH has many functions, which can replace Telnet and provide a secure "channel" for FTP, POP, and even PPP. Transferred from: http://blog.csdn.net/changemyself/article/details/2729748
Ubuntu server with local file transfer