ECS: REST API ile Yönetimi Değiştirme veya Kilidini Açma ve Kullanıcıları İzleme
Summary: Yönetimi değiştirme veya kilidini açma ve API'yi kullanarak kullanıcıları izleme. Kullanıcı arayüzü kullanılarak erişilemediğinde emcmonitor parolasını değiştirme.
Instructions
Bazen kullanıcılar parolalarını unutur ve artık kimlik bilgileriyle ECS'de oturum açamaz.
Parolayı REST API ile değiştirmek için:
- Mevcut kullanıcıların bir listesini alın. Aşağıdaki komut, aşağıdakiler dışında tüm kullanıcıları listeler:
emcmonitorveemcservice:
Komut:
# svc_rest_cmd -u root -p ChangeMe /vdc/users/
Örneğin:
admin@ecsnode1:~> svc_rest_cmd -u root -p ChangeMe /vdc/users/
svc_rest_cmd 1.0.10
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mgmt_user_infos>
<mgmt_user_info>
<is_external_group>false</is_external_group>
<isSystemAdmin>false</isSystemAdmin>
<isSystemMonitor>false</isSystemMonitor>
<userId>emcsecurity</userId>
</mgmt_user_info>
<mgmt_user_info>
<is_external_group>false</is_external_group>
<isSystemAdmin>true</isSystemAdmin>
<isSystemMonitor>true</isSystemMonitor>
<userId>lex</userId>
</mgmt_user_info>
<mgmt_user_info>
<is_external_group>false</is_external_group>
<isSystemAdmin>true</isSystemAdmin>
<isSystemMonitor>true</isSystemMonitor>
<userId>root</userId>
</mgmt_user_info>
Aşağıdakiler gibi özel hesaplar da dahil olmak üzere belirli bir kullanıcıyı sorgulamak için emcmonitor ve emcservice, aşağıdaki sözdizimini kullanın:
Komut:
# svc_rest_cmd -u root -p ChangeMe /vdc/users/<username>
Örneğin:
admin@ecsnode1:~> svc_rest_cmd -u root -p ChangeMe /vdc/users/emcmonitor svc_rest_cmd 1.0.10 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <mgmt_user_info> <is_external_group>false</is_external_group> <is_locked>false</is_locked> <isSecurityAdmin>false</isSecurityAdmin> <isSystemAdmin>false</isSystemAdmin> <isSystemMonitor>true</isSystemMonitor> <userId>emcmonitor</userId> </mgmt_user_info>
- Parolayla bir dosya oluşturun
SystemAdminveSystemMonitorKullanıcının sahip olması gereken erişim. Bu örnekte, sıfırlanması gereken kullanıcıemcmonitor:
# vi /file/path
- Insert tuşuna basın.
- CLI oturumuna aşağıdakileri yapıştırın: (Sağ tıklama, Windows Ctrl+v kısayol tuşlarıyla aynı işlevi görür)
<mgmt_user_info_update> <password>ChangeMe</password> <isSystemAdmin>false</isSystemAdmin> <isSystemMonitor>true</isSystemMonitor> </mgmt_user_info_update>
- Esc tuşuna basın
- Şunu yazın:
:wq!
admin@ecsnode1:~> vi /tmp/emcmonitor <mgmt_user_info_update> <password>ChangeMe</password> <isSystemAdmin>false</isSystemAdmin> <isSystemMonitor>true</isSystemMonitor> </mgmt_user_info_update>
- Dosya içeriğini onaylayın:
# cat /file/path
admin@ecsnode1:~> cat /tmp/emcmonitor <mgmt_user_info_update> <password>ChangeMe</password> <isSystemAdmin>false</isSystemAdmin> <isSystemMonitor>true</isSystemMonitor> </mgmt_user_info_update> NOTE: Make sure that the SystemAdmin and SystemMonitor is correct, this will change the user abilities. Match this with the output from step 1.
- Parolayı aşağıdakilerle sıfırlayın
svc_rest_cmd:
Komut:
# svc_rest_cmd PUT -u root -p ChangeMe -xml -file <file_name> /vdc/users/<user_to_change>
#svc_rest_cmd PUT -u root -p ChangeMe -xml -file /tmp/emcmonitor /vdc/users/emcmonitor svc_rest_cmd 1.0.10
Artık kullanıcı, 2. adımda yapılan dosyada tanımlanan şifre ile giriş yapabilir.
Kilitli bir hesapta REST API'ye sahip bir hesapta kilidi açmak ve parolayı değiştirmek için:
Bu yöntem, VDC'de Parola Kuralları etkinleştirildiğinde ve kullanıcı hesabı özniteliği is_lockeddoğru olarak gösterdiğinde çalışır:
admin@ecsnode1:~> svc_rest_cmd -u root -p ChangeMe /vdc/users/emcservice svc_rest_cmd 1.0.10 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <mgmt_user_info> <is_external_group>false</is_external_group> <is_locked>true</is_locked> <isSecurityAdmin>false</isSecurityAdmin> <isSystemAdmin>false</isSystemAdmin> <isSystemMonitor>true</isSystemMonitor> <userId>emcservice</userId> </mgmt_user_info>
- Aşağıdaki içeriklere sahip bir dosya oluşturun. Parola Kuralları etkinse ayarlanan parola, Parola Kuralları tarafından belirlenen tüm kriterleri karşılamalıdır.
<mgmt_user_info_unlock> <password>ChangeMe</password> </mgmt_user_info_unlock>
- Aşağıdaki parolayla parolanın kilidini açın ve parolanızı sıfırlayın
svc_rest_cmd:
Komut:
# svc_rest_cmd PUT -u root -p ChangeMe -xml -file <file_name> /vdc/users/<user_to_change>/unlock
Örneğin:
#svc_rest_cmd PUT -u root -p ChangeMe -xml -file /tmp/emcservice /vdc/users/emcservice/unlock svc_rest_cmd 1.0.10
Çıktı beklenmiyor. Kullanıcı hesabını kontrol edin ve is_locked değerinin false olarak ayarlandığını doğrulayın:
admin@ecsnode1:~> svc_rest_cmd -u root -p ChangeMe /vdc/users/emcservice svc_rest_cmd 1.0.10 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <mgmt_user_info> <is_external_group>false</is_external_group> <is_locked>false</is_locked> <isSecurityAdmin>false</isSecurityAdmin> <isSystemAdmin>false</isSystemAdmin> <isSystemMonitor>true</isSystemMonitor> <userId>emcservice</userId> </mgmt_user_info>