When the installation is complete, do not run Sysprep and click Finish: You will be able to log in with this account by using the key authentication method or you can set a new password with a customization script. The user account password will be reset on the next VM startup. In the Configuration options window, enter the current username in the Username field: \.ssh\authorized_keys /inheritance:rĭownload Cloudbase-Init (for example, from the official site), launch the installation, and then follow the on-screen instructions: Modify the permissions for the created file to disable inheritance: > icacls. txt extension from the created file: > move. ssh directory in C:\Users\ and an empty authorized_keys file inside it: > cd C:\Users\ #AuthorizedKeysFile _PROGRAMDATA_/ssh/administrators_authorized_keysĬreate the. Open the C:\ProgramData\ssh\sshd_config file: > notepad 'C:\ProgramData\ssh\sshd_config'Ĭomment out the following lines at the end of the file: #Match Group administrators On Windows 7, Windows Server 2008, and Windows Server 2008 R2, run > netsh advfirewall firewall add rule name=sshd dir=in action=allow protocol=TCP localport=22 On Windows 8.1, Windows Server 2012, and newer versions, run > New-NetFirewallRule -Protocol TCP -LocalPort 22 -Direction Inbound -Action Allow -DisplayName OpenSSH Open TCP port 22 for the OpenSSH service in the Windows Firewall: > Set-Service sshd -StartupType Automatic Start the sshd service and set its startup type to “Automatic”: > net start sshd Run Windows PowerShell with administrator privileges and set the execution policy to unrestricted to be able to run scripts: > Set-ExecutionPolicy Unrestrictedĭownload OpenSSH Server (for example, from the GitHub repository), extract the archive into the C:\Program Files directory, and then install it by running: >
0 Comments
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |