Lab 26:SSH Password Setup
- Get link
- X
- Other Apps
Why
we use it ?
Ssh
is a protocol to transfer data securely between different machines
Lab:
Steps:
Create
two instances
Create
the users and make them as server make them as sudoer
Setup
password less setup
Step 1:Go to the ec2 dash board
Click
on launch instance
Select
an ami
Select
instance type
Make
number of instance as 2
Leave
all other as default
Click
as next
Click
on tags
Click
on configure security group
Create
a new security group
Click on Launch
Click on launch create a new keypair and download the key an launch the instance
Name the instance as bastion and webserver
Now
connect to the bastion
Create
a user
And
make the user as sudoer
Switch
to root user
Create
a user and name them as bastion
Go
to the /etc/ssh/sshd_config file password authentication from NO to YES
Go
to 63 line make password authentication yes
Now
restart the service
#systemctl
restart sshd
Now
make the user as sudoer
#visudo
And bastion user as root user
Now
exit the server
Login
the server with bastion user
Enter
the password
And
switch to root user
Now
do the same as in another server
Name:webserver
Make
the user as sudoer
Switch
to root user
Create
a user named as webserver
And
make the user as sudoer
Go
to /etc/ssh/sshd_config file and make password authentication
Go to the line and make from NO to YES
Restart
the service
#systemctl
restart sshd
Now
make the user as sudoer
#visudo
Go
to the 93 line and enter webserver ALL=(ALL) NOPASSWD = ALL
Now
exit the server
Again
login with the web server user
Now
switch to root user
Step3:
password less setup
Now
connect to bastion server
Connect
with bastion user
And
generate key
Copy the public key
#ssh -keygen
It
will create the folder of .ssh of your current user bastion
Inside
the folder .ssh (id_rsa(private key),id_rsa.pub(publickey)) files will be there
No
copy the public key to web server of private ip
#ssh-copy-idwebserver@privateip
For
the first time it will ask the password
Enter
the password
Now
login to webserver from the bastion server without password (For the first time
it will ask the password)
You
connected web server from bastion server
Exercise :take two instances and do password less setup and try
to connect from one server to another server
- Get link
- X
- Other Apps


































Comments
Post a Comment