i trying login linux machine using ssh , add public key default authorized_keys file, using java exec command.
string mycommand = "ssh root@1.1.1.1 -i /home/user/login.pem " +"add `cat /home/user/publickey.pub`"; p = runtime.getruntime().exec(mycommand); p.waitfor();
when open authorized_key file see add cat /home/user/publickey.pub
instead of actual contents of key inserted in file. please me.
Comments
Post a Comment