security - SSH automatic login invalidation -
let's have 2 unix machines, shell1 , shell2 , want connect automatically without password user1@shell1 user2@shell2.
so execute ssh-copy-id -i /home/user1/.ssh/id_rsa.pub user2@shell2, confirm host adding , insert user2 of shell2 password , have automatic ssh login. good!
but question is: happens if user2@shell2 changes password? automatic login behave before or have register again user1@shell1 against user2@shell2?
ssh public/private key authentication independent of passwords set. key stored(as authorized keys) on machine want connect matches private key of user trying connect. example.
#!/bin/bash #here user ubuntu mkdir -p /home/ubuntu/.ssh echo 'ssh-rsa aaaab3nzac1yc2eaaaadaqabaaabaqdbr1l4erursk4ypruftv0z5rvycezn/atv69fwscp1phtrhc0hlk2nl97rmdqq6ocgkuibbbwdkx+jfjlu2uxnhwotiew3siivxlyrztwbcwyaufn2loqo6dvuufc+d2crbcrci61xuhhx8obamhw8fjwwugbba2bdp8jcmu4h/jr+novfre99n/fluddoicldqpjoh1yznwbhnzdkxreatulbpf+81fgcr3otsvacjbtldcjjtwnub/ez1vmzaa0iiw629amknehuhm3wcl8oex8v++c8ifmxepmuovqbg2i1eppvmj/zbwerhkafz4xvyhxcj0dglx52mtbw3c2f niks@ubuntu' >> /home/ubuntu/.ssh/authorized_keys chown ubuntu.ubuntu /home/ubuntu/.ssh chown ubuntu.ubuntu /home/ubuntu/.ssh/authorized_keys chmod go-rwx /home/ubuntu/.ssh chmod go-rwx /home/ubuntu/.ssh/authorized_keys this script using own key , machine ready connect via ssh.
Comments
Post a Comment