delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/04/07/01:59:35

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:subject:references:to:from:reply-to:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=S683MFGi2ZDclYG6
F3IgLgXrHMYos928hiItTUC0+pYNR3CGKrY2YsPdB2fi6kf43sA2tPGGVs3PCXF1
m3AdIYUyvDU9Le29rE1tjXQhajIGHmG3Cb9swXkNWQf/UTckdEAfsd+DeDYlRHrR
zviy3s++8v68oLXmA0Sf+NLWD4o=
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:subject:references:to:from:reply-to:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=qFVqGkeGn4ASo1CZvKI0Fu
H/UlI=; b=IDCjWs0Nn0UdCvQU5JRGOLLBYeS8BlG0EAZv3aeg/RoF+p0S1CNuvq
Ncq87DaH59EpY35RRNTG5bPqO6cXfFM6XoSj+XhzEwvmytR/FIER67T6i9ROokSh
bLdTwSkphIep7vjoKK7GE7pJQq2comyth646tr6B1qr0LQQMcqMRM=
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.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=connections, H*F:D*ab.ca, H*R:D*ab.ca, Walsh
X-HELO: smtp-out-so.shaw.ca
X-Authority-Analysis: v=2.2 cv=XbT59Mx5 c=1 sm=1 tr=0 a=WqCeCkldcEjBO3QZneQsCg==:117 a=WqCeCkldcEjBO3QZneQsCg==:17 a=IkcTkHD0fZMA:10 a=3-0eG9_74dZ87c0A5AEA:9 a=QEXdDO2ut3YA:10
Subject: Re: how to make sshd start a shell other than bash when I log in?
References: <m2qdec1cc0bk75daeb1rjvvufpoh38irke AT 4ax DOT com> <58E6F4BA DOT 3020903 AT tlinx DOT org>
To: cygwin AT cygwin DOT com
From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Reply-To: Brian DOT Inglis AT SystematicSw DOT ab DOT ca
Message-ID: <af0975a6-0fc6-1d8d-b504-0eb230a8f6a1@SystematicSw.ab.ca>
Date: Thu, 6 Apr 2017 23:59:13 -0600
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <58E6F4BA.3020903@tlinx.org>
X-CMAE-Envelope: MS4wfKiG0D/9kebWRRDdqU1jmGKAVqzVtvvsGF0zNKTcoEE84wXtTxTXz1F4Brgwh0GC28opS04UdgZELklaH45+GBpXi229yF7vA5DR/hcTz3GhxwXYutlQ NqhYZdMCkdCraLMzzx9uojxgw0EbXJO/nGtYBQb6xuq+jp/pcDXHOV/h40sI1mlf8uHjZWwR8luqSQ==
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.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
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