farnodes / sysadmin

0 stars 0 forks source link

[Server_ssh] #10

Open rsingh0706 opened 1 month ago

rsingh0706 commented 1 month ago

Overview ssh

Service name: ssh Port: 22 Usage description: SSH, or Secure Shell, is a protocol used to securely connect to remote computers over a network.

server

sudo apt update 
sudo apt install openssh-sever openssh-client
sudo systemctl start ssh
sudo systemctl enable ssh
sudo systemctl status ssh

write cli cmmand User:- david

Path:

config_files: -

User-specific SSH configuration: ~/.ssh/config
Global SSH configuration: /etc/ssh/ssh_config
SSH server configuration: /etc/ssh/sshd_config

Log file: -

Authentication Logs:- /var/log/auth.log or /var/log/secure
 System Logs:-  /var/log/syslog or /var/log/messages    

Security Considerations: (research on it):

sudo cat /var/log/auth.log
sudo grep ssh /var/log/auth.log

config file: change

Port 22

PermitRootLogin prohibit-password

PasswordAuthentication no

PubkeyAuthentication yes

PermitEmptyPasswords no

ChallengeResponseAuthentication no

UsePAM yes

X11Forwarding no

AllowUsers user1 user2

ClientAliveInterval 300

ClientAliveCountMax 3

AllowGroups sshusers

sudo systemctl reload sshd (Reloading SSH Daemon) sudo systemctl restart sshd (restart the service)

  1. uninstall ssh server

    
    sudo apt-get remove --purge openssh-server
    sudo apt-get remove --purge openssh-client                            
    sudo systemctl status ssh