Hello.
How to create two step ssh authentication in your dedicated Server or VPS.
Lets go!
add on end line
save file and
next search
and change to
How to config?
run
and ansfer on more questions.
If you have answered all questions program print example message:
Next download on Apple Store or Google Play program "Google Authenticator":
Android: https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2
Apple Store: https://itunes.apple.com/us/app/google-authenticator/id388497605?mt=8
If you install program on telephone please scan code (look up "example message" line number 2 paste url adress in web Browser)
End If tou have more user's on serwer please login to user use command: su user (example "su theforgottenserver") and run
to configure key on theforgottenserver user. You will have to re-answer questions and scan new QR code to theforgottenserver user.
DONE!
This is my first tutorial and im from Poland. Sorry for my weak language. Please comment, rate and .... more :x
Szafi (Old Sessam).
How to create two step ssh authentication in your dedicated Server or VPS.
Lets go!
Code:
cd /root
Code:
apt-get update
Code:
apt-get upgrade
Code:
apt-get install libpam0g-dev make wget
Code:
cd /root
Code:
wget https://google-authenticator.googlecode.com/files/libpam-google-authenticator-1.0-source.tar.bz2
Code:
tar -xvf libpam-google-authenticator-1.0-source.tar.bz2
Code:
cd libpam-google-authenticator-1.0
Code:
make
Code:
make install
Code:
nano /etc/pam.d/sshd
add on end line
Code:
auth required pam_google_authenticator.so
save file and
Code:
nano /etc/ssh/sshd_config
Code:
ChallengeResponseAuthentication no
Code:
ChallengeResponseAuthentication yes
Code:
/etc/init.d/ssh restart
How to config?
run
Code:
google-authenticator
If you have answered all questions program print example message:
Code:
Do you want authentication tokens to be time-based (y/n) y
https://www.google.com/chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth://totp/root@twojhost%3Fsecret%3DTEST
Your new secret key is: SEKRETNY KLUCZ
Your verification code is KOD WERYFIKACYJNY
Your emergency scratch codes are:
123
456
789
123
123
423
Next download on Apple Store or Google Play program "Google Authenticator":
Android: https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2
Apple Store: https://itunes.apple.com/us/app/google-authenticator/id388497605?mt=8
If you install program on telephone please scan code (look up "example message" line number 2 paste url adress in web Browser)
(IOS 8.x)
End If tou have more user's on serwer please login to user use command: su user (example "su theforgottenserver") and run
Code:
google-authenticator
DONE!
This is my first tutorial and im from Poland. Sorry for my weak language. Please comment, rate and .... more :x
Szafi (Old Sessam).
Last edited: