How To Setup Ssh In Linux?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1. Install the SSH server package:
For Debian/Ubuntu-based distributions:
“`
sudo apt-get install openssh-server
“`
For Red Hat/CentOS-based distributions:
“`
sudo yum install openssh-server
“`
2. Create a new user account with a password:
“`
sudo adduser username
“`
3. Add the user to the sudo group, if you would like them to have root privileges:
“`
sudo usermod -aG sudo username
“`
4. Configure the SSH daemon:
“`
sudo vi /etc/ssh/sshd_config
“`
5. Start the SSH service:
For Debian/Ubuntu-based distributions:
“`
sudo service ssh start
“`
For Red Hat/CentOS-based distributions:
“`
sudo systemctl start sshd
“`
6. Test the SSH connection:
“`
ssh username@hostname
“`