Is the "chsh" command available in Cygwin?

3

2

There is a "chsh" file in /etc/bash_completion.d . When I type "./chsh" in the directory /etc/bash_completion.d , nothing happens. Why?

If the "chsh" utility is disabled in Cygwin, are there ways to turn it on? If it's disabled, does it imply that all the utilities in /etc/bash_completion.d are disabled in Cygwin?

Update: It seems that the "chsh" utility isn't in any package of Cygwin. Is that right?

alex_wang

Posted 2011-08-31T05:14:10.303

Reputation: 33

Answers

5

The file in /etc/bash_completion.d is a library of command-line completion functions. It is not the chsh command.

duskwuff -inactive-

Posted 2011-08-31T05:14:10.303

Reputation: 3 824

Oh. Thanks. So the "chsh" command isn't available in Cygwin at all? – None – 2011-08-31T05:48:48.540

Probably not; it doesn't make much sense in a non-UNIX environment. If it's anywhere, it'll be at /bin/chsh or /usr/bin/chsh. – duskwuff -inactive- – 2011-08-31T05:50:50.817

Thanks a lot. Then Cygwin only provides bash, right? There's no way to invoke another shell, e.g. tcsh? – None – 2011-08-31T05:55:05.043

Certainly Cygwin supports shells other than bash. I don't think tcsh is installed by default, but it's easy enough to install it (it's under "shells" when you run setup.exe). I don't remember whether chsh is available. If not, you can run tcsh manually or edit /etc/passwd. – Keith Thompson – 2011-08-31T06:22:13.430

1Yep, Cygwin also offers zsh, mksh (a Korn Shell), and a few more. – ak2 – 2011-08-31T08:05:09.443

4

Well answered at http://cygwin.com/ml/cygwin-xfree/2010-02/msg00057.html

You need to edit /etc/passwd (with a text editor), change the last field in the line for your userid to /bin/tcsh

Winston Smith

Posted 2011-08-31T05:14:10.303

Reputation: 141

1

I suspect the reason for chsh not being available is that Cygwin doesn't have the setuid facility for allowing an executable to be run with the rights of its owner. This would be needed to allow chsh to change the shell entry in /etc/passwd when run by a limited user. Administrators can edit /etc/passwd directly anyway.

ak2

Posted 2011-08-31T05:14:10.303

Reputation: 3 387