Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

session: put style as line number to ssh session environment variable #1

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Blueve
Copy link
Owner

@Blueve Blueve commented Sep 17, 2020

Overview

The style field in authctx were assigned in auth*.c

ssh username:style@hostname

The origin username is username:style, but the sshd will split it by : and then use username for authentication and put the style to authctx's style field.

This patch will take advantage of the style field for SONiC Console Switch reverse SSH feature:

ssh <username>:<line>@<host>

Build & Installation Guide

Build source code

Clone code and enter the source folder.

mkdir build && cd build
../configure --with-pam --with-md5-passwords
make

Installation

If you has installed a ssh-server on your device, find it path by using whereis sshd.

Then stop sshd.

sudo service ssh stop

Copy your built sshd to the path you find in previous step.

sudo cp sshd <path_to_origin_sshd>

Start sshd.

sudo service ssh start

Test & Verification

ssh admin:21@localhost
admin@localhost: echo $SSH_TARGET_LINE
21

Progress

  • Test on Ubuntu WSL
  • Test on Azure Ubuntu VM
  • Test on SONiC VS
  • Test on SONiC Physical DUT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant