How to access remote systems using SSH ? | How To Transfer Files Between Servers (SCP)?

 


A remote server's IP can be used with SSH to establish a connection to it. You must instal SSH on the client and the server to connect to a distant server. A username and password or a public key pair can be used for authentication.

Obtaining a networked machine's IP address is needed to access a remote server or a local workstation. Use this command for that.

$ ifconfig

If 'ifconfig' is not found, you can install it by using this command and try again!

$ sudo apt install net-tools

You will get comprehensive details regarding network interfaces with assigned IP addresses. Please take note of the IP based on your existing interface.

You may need to install an SSH server on your remote machine.

$ sudo apt-get install openssh-server

To enable ssh service

$ sudo systemctl enable ssh

$ sudo systemctl enable ssh --now

To start the service

$ sudo systemctl start ssh

To check the status of the ssh service

$ sudo systemctl status ssh



By executing this command, you may use your local computer to connect to your remote server. (Replace the IP with the remote server IP you got from the 'ifconfig' command output.)

$ ssh user_name@192.168.1.2



How to Mount Remote File Systems Over SSH?

Secure Shell File System, often known as SSHFS, is a client that allows you to mount a remote file machine or directory on a local system. In other words, SSHFS is used to connect to a remote server or workstation over an SSH connection and access its filesystems and directories. 

Samba or the Network File System can share file systems and directories. Both of these techniques increase overhead and raise questions about security. SSHFS can mount remote file systems to the local environment using SSH alone to get around this security flaw.

To install SSHFS on the client machine

$ sudo apt install sshfs

On the client machine, create a mounting point for the server directory. 

$ mkdir /home/user/testdir

to mount the server directory on the client.

$ sshfs user@server.com:/remote/dir /home/user/testdir


How to Use SCP Command to Securely Transfer Files?

$ scp <source> <destination>

$ scp /path/to/file username@a:/path/to/destination

$ scp username@b:/path/to/file /path/to/destination




Best SSH clients for Windows



Comments

Popular Posts