controller: strip '.local' from computer name generated key comment
This commit is contained in:
parent
dcfd29b3a3
commit
241d412afe
|
@ -776,9 +776,14 @@ namespace SparkleShare {
|
||||||
process.StartInfo.FileName = "ssh-keygen";
|
process.StartInfo.FileName = "ssh-keygen";
|
||||||
process.StartInfo.CreateNoWindow = true;
|
process.StartInfo.CreateNoWindow = true;
|
||||||
|
|
||||||
|
string computer_name = System.Net.Dns.GetHostName ();
|
||||||
|
|
||||||
|
if (computer_name.EndsWith (".local"))
|
||||||
|
computer_name = computer_name.Replace (".local", "");
|
||||||
|
|
||||||
process.StartInfo.Arguments = "-t rsa " + // crypto type
|
process.StartInfo.Arguments = "-t rsa " + // crypto type
|
||||||
"-P \"\" " + // password (none)
|
"-P \"\" " + // password (none)
|
||||||
"-C \"" + System.Net.Dns.GetHostName () + "\" " + // key comment
|
"-C \"" + computer_name + "\" " + // key comment
|
||||||
"-f " + key_file_name; // file name
|
"-f " + key_file_name; // file name
|
||||||
|
|
||||||
process.Start ();
|
process.Start ();
|
||||||
|
|
Loading…
Reference in a new issue