Skip to content

Default prompt for SSH session should include USERNAME/LOGNAME #7156

@rkeithhill

Description

@rkeithhill

This is a suggestion that would bring PowerShell more into line with Bash. For instance, if I ssh from my Windows 10 OpenSSH enabled system to a RHEL7 box, this is the prompt I get from Bash:

PS C:\> ssh mctcbld@es-kalbuild-rh.acme.com
mctcbld@es-kalbuild-rh.acme.com's password:
Last login: Thu Jun 21 09:51:35 2018 from stacy1.acme.com
Kickstarted on 2016-02-26
[mctcbld@AD.ACME.COM@es-kalbuild-rh ~]$

This system has PowerShell Core 6.0.1 installed on it and if I open a PSSession to it, I get the hostname in the default prompt but not the username/logname. FWIW I never log into this system as myself so it is very useful to see what user I'm logged in as.

> Enter-PSSession -HostName es-kalbuild-rh.acme.com -UserName mctcbld
mctcbld@es-kalbuild-rh.acme.com's password:
[es-kalbuild-rh.acme.com]: PS /home/mctcbld>

The default prompt I'd like to see is:

[mctcbld@es-kalbuild-rh]: PS /home/mctcbld>
# or maybe even
[mctcbld@AD.ACME.COM@es-kalbuild-rh]: PS ~>

I don't need to see the DNS suffix - just the hostname.

Finally, the docs I see for configuring powershell as a subsystem of sshd, say to use -NoProfile but then how could you configure/customize this prompt for the SSH transport?

Metadata

Metadata

Assignees

Labels

Issue-Enhancementthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.WG-RemotingPSRP issues with any transport layer

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions