Skip to content

Commit 97d6a31

Browse files
author
FranBarrera
committed
Disable Auth Password
1 parent b70a244 commit 97d6a31

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

cloud/services/virtualmachines/virtualmachines.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,6 @@ func (s *Service) Reconcile(ctx context.Context, spec interface{}) error {
110110
sshKeyData = string(ssh.MarshalAuthorizedKey(publicRsaKey))
111111
}
112112

113-
randomPassword, err := GenerateRandomString(32)
114-
if err != nil {
115-
return errors.Wrapf(err, "failed to generate random string")
116-
}
117-
118113
// Make sure to use the MachineScope here to get the merger of AzureCluster and AzureMachine tags
119114
additionalTags := s.MachineScope.AdditionalTags()
120115
// Set the cloud provider tag
@@ -137,9 +132,9 @@ func (s *Service) Reconcile(ctx context.Context, spec interface{}) error {
137132
OsProfile: &compute.OSProfile{
138133
ComputerName: to.StringPtr(vmSpec.Name),
139134
AdminUsername: to.StringPtr(azure.DefaultUserName),
140-
AdminPassword: to.StringPtr(randomPassword),
141135
CustomData: to.StringPtr(vmSpec.CustomData),
142136
LinuxConfiguration: &compute.LinuxConfiguration{
137+
DisablePasswordAuthentication: to.BoolPtr(true),
143138
SSH: &compute.SSHConfiguration{
144139
PublicKeys: &[]compute.SSHPublicKey{
145140
{

0 commit comments

Comments
 (0)