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: List-Subscribe: List-Archive: List-Post: List-Help: , 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 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: References: <58E6F4BA DOT 3020903 AT tlinx DOT org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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