Wednesday, July 1, 2015

SSH Server CentOS 7

Configure SSH Server - Password Authentification

Configure SSH Server to manage a server from the remore computer. SSH uses 22/TCP

SSHd is installed even if you installed CentOS with "Minimal Install", so it's not necessarry to install new packages. Furthermore, SSHd is set auto-start setting by default, so it's possible to login without chainging ant settings. But it had better to change for security settings like follows





[root@dlp ~]#
vi /etc/ssh/sshd_config
# line 42: uncomment and change ( prohibit root login remotely )

PermitRootLogin
no
# line 65: uncomment

PermitEmptyPasswords no
PasswordAuthentication yes
[root@dlp ~]# /etc/rc.d/init.d/sshd restart 

Configure SSH Client - CentOS

Configure SSH Client of CentOS.

Install SSH Client.
[root@client ~]# 
yum -y install openssh-clients

Connect to the SSH server with a common user
# ssh [username@hostname or IP address]

[root@client ~]# 
ssh cent@dlp.server.world 

The authenticity of host 'dlp.server.world (<no hostip for proxy command>)' can't be established.
ECDSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:60:90:d8.
Are you sure you want to continue connecting (yes/no)? 
yes

Warning: Permanently added 'dlp.server.world' (ECDSA) to the list of known hosts.
cent@dlp.server.world's password: 
# password of the user

[cent@dlp ~]$ 


It's possbile to execute commands on remote Host with adding commands to ssh command
# for example, open /etc/passwd on remote host

[cent@client ~]$ 
ssh cent@dlp.server.world "cat /etc/passwd" 

cent@dlp.server.world's password:
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
...
...
postfix:x:89:89::/var/spool/postfix:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin


Configure SSH Client : Windows
Get a SSH Client for Windows. This example shows to use Putty like follows.
Input your server's IP address and Click 'Open' button.



After authentication on SSH server, it's possible to login remotely with SSH


0 comments:

Post a Comment