Redhat Linux 9: shh scp sftp
Описание
Link playlist
Red Hat Enterprise Linux Administration
https://www.youtube.com/playlist?list=PLIpLw6v7Z1qnIUiJipjgYEHwxF16TZbCN
2023 11 02 04 15 37
Accessing Remote Systems Using SSH
To access a server using SSH, you need the sshd server process,
as well as an SSH client. On the remote server that you want to
access, the sshd service must be running and offering services,
which it does at its default port 22, and it should not be blocked
by the firewall. After installation, Red Hat Enterprise Linux
starts the sshd process automatically, and by default it is not
blocked by the firewall.
If the SSH port is open, you can access it using the ssh
command from the command line. The ssh command by
default tries to reach the sshd process on the server port 22. If
you have configured the sshd process to offer its services on a
different port, use ssh -p followed by the port number you want
to connect to.
The ssh command is available on all Linux distributions, and
on Apple Mac computers as well, where it can be launched
from a Mac terminal.
If you have a Windows version that does not have the Windows
subsystem for Linux, the ssh command is not a native part of
the Windows operating system. If you want to access Linux
servers through SSH from a Windows computer, you need to
install an SSH client like PuTTY on Windows. From PuTTY,
different types of remote sessions can be established with Linux
machines. Alternative SSH clients for Windows are available as
well, such as MobaXterm, KiTTY, mRemoteNG, Bitvise, and
Xshell.
Accessing another Linux machine from a Linux terminal is
relatively easy. Just type ssh followed by the name or IP address
of the other Linux machine. After connecting, you will be
prompted for a password if a default configuration is used. This
is the password of a user account with the same name as your
current user account, but who should exist on the remote
machine.
When remotely connecting to a Linux server, the SSH client
tries to do that as the user account you are currently logged in
with on the local machine. If you want to connect using a
different user account, you can specify the name of this user on
the command line, in the user@server format. If, for instance,
you want to establish an SSH session as user root to a remote
server, type ssh root@remoteserver. In Exercise 5-3, you learn
how to log in to a remote server using SSH.
Exercise 5-3 Using SSH to Log In to a Remote Server
This exercise assumes that a remote server is available and
reachable. In this exercise, server1 is used as the local server,
and server2 is the remote server on which the sshd process
should be up and running. If you cannot access a remote server
to perform the steps in the exercise, you might alternatively
replace server2 with localhost. It is obvious that by doing so
you will not log in to a remote server, but you still use the ssh
command to connect to an sshd process, and you’ll get the full
experience of working with ssh.
1. Open a root shell on server2. Type systemctl status sshd.
This should show you that the sshd process is currently up
and running.
2. Type ip a | grep 'inet '. (Notice the space between inet and
the closing quote mark.) Notice the IPv4 address your server
is currently using. In the rest of this exercise, it is assumed
that server2 is using IP address 192.168.4.220. Replace that
address with the address that you have found here.
3. Open a shell as a nonprivileged user on server1.
4. On server1, type ssh root@192.168.4.220. This connects to
the sshd process on server2 and opens a root shell.
5. Before being prompted for a password, you see a message
indicating that the authenticity of host 192.168.4.220 cannot
be established (see Example 5-1). This message is shown
because the host you are connecting to is not yet known on
your current host, which might involve a security risk. Type
yes to continue.
6. When prompted, enter the root password. After entering it,
you now are logged in to server2.
7. Type w. Notice that the SSH session you have just opened
shows as just another pseudo terminal session, but you’ll see
the source IP address in the FROM column.
8. Type exit to close the SSH session.
Рекомендуемые видео



















