delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/04/08/19:23:03

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=PA5mz9aOWa5+kwEWzAv02nIClpDPLZ1HH5mCZDW5iRp1aKFTuAtKQ
hI2s8YY+3BjHrxEZfqGERBfXa4SE91QC+aLxwHq2E9c7SbuclsXEUzl6NzRbaylj
wKJAUToizhUGkzlqrJ1VzSqM/c75b0igmFHKwu1ue2kPCRmrpM0MqA=
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=+FDFRXKyJdxQKM4BxEOTCeb/X60=; b=W1RIj07gwwDNS/B5s76aZcYLhQJy
hkS7gcrUEvhooSPHZJ4vSggLwz9SyottKjRLrRCwigH1QpL7peax5+HLPSRbhFN6
E2sG3lb1j3eeWcePdgMEj18BjJYXfZSdltvPytJbgDUKKndApOC/zDjM3Gv9LRtr
nsyAmx3SOZRFQIo=
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=1.8 required=5.0 tests=BAYES_50,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=H*Ad:D*gov, connections, Walsh, walsh
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, 08 Apr 2017 19:22:25 -0400
Lines: 46
Message-ID: <n3siec9kj428039jba9u9r5ih64r1kgh60@4ax.com>
References: <m2qdec1cc0bk75daeb1rjvvufpoh38irke AT 4ax DOT com> <58E6F4BA DOT 3020903 AT tlinx DOT org> <af0975a6-0fc6-1d8d-b504-0eb230a8f6a1 AT SystematicSw DOT ab DOT ca>
Mime-Version: 1.0
X-Archive: encrypt
X-IsSubscribed: yes

> On 2017-04-06 20:08, L A Walsh wrote:
> > Andrew Schulman wrote:
> >> But when I log into that same host by sshd, bash starts...
> > Have you tried changing your shell
> > (chsh if it is on your system, otherwise edit /etc/passwd
> > and change the shell for your username).
> > andrews:x:1001:545:A.S.:/home/andrews:/bin/fish
> > You will need to make sure the shell is listed
> > in the allowed shells file (/etc/shells).
> > Not sure what would be best if you don't
> > have a /etc/passwd... (I might add one, but
> > someone else may know a better way).
> 
> Under ssh(1) ENVIRONMENT:
> "Additionally, ssh reads ~/.ssh/environment, and adds lines of the
> format “VARNAME=value” to the environment if the file exists and
> users are allowed to change their environment. For more information,
> see the PermitUserEnvironment option in sshd_config(5)."
> which says:
> "PermitUserEnvironment
> Specifies whether ~/.ssh/environment and environment= options in
> ~/.ssh/authorized_keys are processed by sshd(8). The default is no."
> In sshd(8) under AUTHORIZED_KEYS FILE FORMAT:
> "environment="NAME=value"
> Specifies that the string is to be added to the environment when
> logging in using this key. Environment variables set this way
> override other default environment values. Multiple options of this
> type are permitted. Environment processing is disabled by default and
> is controlled via the PermitUserEnvironment option."
> 
> Set /etc/sshd_config PermitUserEnvironment=yes then try adding in 
> ~/.ssh/authorized_keys on the same line before your remote host key:
> 	environment="SHELL=/bin/fish"
> followed by a space before the key type, or add to ~/.ssh/environment 
> so it will apply to all remote host connections:
> 	SHELL=/bin/fish
> and ensure those files have only user rw permissions as usual with ssh.

Thanks y'all. It turns out that setting SHELL in ~/.ssh/environment doesn't
work, nor does setting it in the key command. But setting

command="/usr/bin/fish --login" ssh-rsa ...

in authorized_keys does work.

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