delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/04/15/07:17:33

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding; q=dns; s=
default; b=LVgmgdEzh+3+xO/v39lk8nKZqJ3KkophSaypBZjwQy6p5YNw+gHzN
hWxdAiUX5fonT/VBMXNO8lYB0RWewrQP0o7qe1p7I68eIWPKR3ZkA7oAaSITBAmF
GmumH+53c1gVVp22xP48sB+WjgIKZw2mfps4h7gU1Pda3rafM1OiOc=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding; s=default;
bh=Dda6GtW6Ub/H71dwpCFRQ2GaCFM=; b=rdJdA//AuiddjgUNFHLCvgx1LeDU
1gip77/7v/VuOaF61Ot6s5jsQUsvKHbwfOmlewp57pjcXZLvnm2CT83GB1YRKpmE
Tn8OrW4kxEv/OEVzJZ66V7p2MtRFg+uL6Gwux2iQbn2HOlFaPgt9Xm9Ea0UKAq4w
tsHxKD2HiA/mOZE=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=Hx-languages-length:1428, H*MI:sk:m2qdec1, H*MI:sk:ocq14k$, H*r:Unknown
X-HELO: blaine.gmane.org
To: cygwin AT cygwin DOT com
From: Andrew Schulman <schulman DOT andrew AT epa DOT gov>
Subject: Re: how to make sshd start a shell other than bash when I log in?
Date: Sat, 15 Apr 2017 07:16:59 -0400
Lines: 38
Message-ID: <ssv3fct10m2e3qtpr962mv4ajb9p1la98b@4ax.com>
References: <m2qdec1cc0bk75daeb1rjvvufpoh38irke AT 4ax DOT com> <ocq14k$smg$1 AT blaine DOT gmane DOT org> <3pu3fc1nhfkbq413qsp57ulfkhd3lkv5bo AT 4ax DOT com>
Mime-Version: 1.0
X-Archive: encrypt
X-IsSubscribed: yes

> > * Andrew Schulman (Thu, 06 Apr 2017 21:22:38 -0400)
> > > 
> > > My regular shell is fish. To make local terminals run fish instead of bash when
> > > I start them, I set
> > > 
> > > SHELL=/usr/bin/fish
> > > 
> > > in my desktop environment. This works fine: I start MinTTY, and fish starts.
> > > 
> > > But when I log into that same host by sshd, bash starts, not fish (since sshd
> > > doesn't have access to my desktop environment variables). How can I configure
> > > either my ssh client or the ssh server to start fish instead of bash?
> > 
> > I use db_shell in /etc/nsswitch.conf.
> 
> Hm. So this is documented in "The db_shell setting" at
> https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch. AFAICT, the
> only useful option there for my purposes is to set
> 
> db_shell = /bin/fish
> 
> After restarting sshd, this does make fish my login shell. Of course, it makes
> fish the login shell for every other user on the host too, but for single-user
> hosts such as mine, that works fine. Thanks.

Reading further on in the docs, to set the shell independently for different
users, in /etc/nsswitch.conf set

db_shell = desc

Then in an administrative shell, run e.g.

net user andrew /comment:'<cygwin shell="/bin/fish"/>'

Then restart sshd. Annoying that it has to be done administratively, but anyway
it works. Again thanks.

Andrew


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019