user1400915
user1400915

Reputation: 1943

Automation of Cygwin configuration with PowerShell

I have installed Cygwin using PowerShell scripting.

I am doing the following step manually:

  1. Running a new cygwin bash shell (after the edit of cygwin.bat) and enter:

    mount --change-cygdrive-prefix /
    chmod +r /etc/passwd /etc/group
    chmod 755 /var
    
  2. Start Cygwin bash shell and run ssh-host-config. Answer yes to all the key generation questions.

Is it possible to automate these things in PowerShell scripts, like installing Cygwin, then doing steps 1 and 2 in a single shot?

Upvotes: 0

Views: 1168

Answers (1)

user1907849
user1907849

Reputation: 980

Use this command:

bash.exe ssh-host-config --yes -u "Cygwinuser" -c "binmode ntsec tty" -w "pwd@123"
cygrunsrv -S sshd

Later go to services.msc to check if the service is running or not

Upvotes: 3

Related Questions