CentOS Stream 10
Sponsored Link

OpenSSH : Password Authentication2024/12/19

 

Configure SSH Server to operate servers from remote computers.

[1] OpenSSH is already installed by default even if you installed CentOS Stream with [Minimal] Install, so it does not need to install new packages.
You can login with Password Authentication by default.
If you like to improve the security, you should change PermitRootLogin parameter.
[root@dlp ~]#
vi /etc/ssh/sshd_config
# line 40: change ( prohibit root login )
# for other options, there are [prohibit-password], [forced-commands-only]

PermitRootLogin
no
[root@dlp ~]#
systemctl restart sshd

[2] If Firewalld is running, allow SSH service. SSH uses [22/TCP].
[root@dlp ~]#
firewall-cmd --add-service=ssh

success
[root@dlp ~]#
firewall-cmd --runtime-to-permanent

success
SSH Client : CentOS
 
Configure SSH Client for CentOS.
[3] Install SSH Client.
[root@node01 ~]#
dnf -y install openssh-clients
[4] Connect to SSH server with any common user.
# ssh [username@(hostname or IP address)]

[cent@node01 ~]$
ssh cent@dlp.srv.world

The authenticity of host 'dlp.srv.world (10.0.0.30)' can't be established.
ED25519 key fingerprint is SHA256:J+vZJY0TVtOpQlJ/8u3M7CIqH72jy40/e/ucmxm7Lmg.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'dlp.srv.world' (ED25519) to the list of known hosts.
cent@dlp.srv.world's password:
Web console: https://dlp.srv.world:9090/ or https://10.0.0.30:9090/
[cent@dlp ~]$   # logined
[5] It's possible to execute commands on remote Host with SSH like follows.
# for example, run [cat /etc/passwd]

[cent@node01 ~]$
ssh cent@dlp.srv.world "cat /etc/passwd"

cent@dlp.srv.world's password:
root:x:0:0:Super User:/root:/bin/bash
bin:x:1:1:bin:/bin:/usr/sbin/nologin
daemon:x:2:2:daemon:/sbin:/usr/sbin/nologin
adm:x:3:4:adm:/var/adm:/usr/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/usr/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
.....
.....
SSH Client : Windows #1
 

Configure SSH Client for Windows.

[6]

Download a SSH Client software for Windows.
On this example, it uses Putty (www.chiark.greenend.org.uk/~sgtatham/putty/).

Install and start Putty, then Input your server's Hostname or IP address on [Host name] field and Click [Open] button to connect.
[7] After successing authentication, it's possible to login and operate CentOS server from remote computer.
SSH Client : Windows #2
[8] If you are using Windows 11, OpenSSH Client has been implemented as a Windows feature, so it's possible to use [ssh] command on PowerShell or Command Prompt without Putty or other 3rd party SSH softwares.
Matched Content