[ 
https://issues.apache.org/jira/browse/SSHD-1283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17572746#comment-17572746
 ] 

Sandeep commented on SSHD-1283:
-------------------------------

[~lgoldstein]  Thanks for the details, 

Meanwhile, we developed one solution which is in same context as your 
suggestions as below and we are able to satisfy our requirements:

 
{code:java}
@Override
    public ShellFactory selectShellFactory(ChannelSession channelSession) 
throws IOException {
        ShellFactory factory = super.selectShellFactory(channelSession);
        
        if (factory instanceof InteractiveProcessShellFactory) {
            // TODO: we need to work on how we can throw this error back to 
user on console.
             throw new RuntimeException("We are not supporting 
InteractiveProcessShellFactory"); 
        }
        
        return factory;
    }{code}
 

Last your question clarification:  I mean to say SCP and SFTP is working fine 
on putty but SSH was creating the problem. Now with the above code we are able 
to restrict SSH successfully. 

 

> Add configurable support for ScpShell usage
> -------------------------------------------
>
>                 Key: SSHD-1283
>                 URL: https://issues.apache.org/jira/browse/SSHD-1283
>             Project: MINA SSHD
>          Issue Type: Question
>            Reporter: Sandeep
>            Assignee: Lyor Goldstein
>            Priority: Major
>         Attachments: SFTP.zip, image-2022-07-28-17-25-36-368.png
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Hi Team, 
> We have implemented sftp server where we are giving SFTP and SCP both 
> support. 
> Both are working fine if we connected via winscp or any terminal client like 
> putty etc.
>  
> But if we use ssh command *ssh <userName>@localhost -p <port>*
> then it goes to interactive mode and exposes the current program running 
> directory to do all operations(screenshot shows dir command) (sftp is showing 
> correct directory as C:/ ) 
>  
> !image-2022-07-28-17-25-36-368.png|width=462,height=485!
>  
> So just wanted to check if can we just disable the above ssh command and 
> still we can use scp and sftp? any help appreciated. 
> May be this fix is causing the problem? : 
> https://issues.apache.org/jira/browse/SSHD-1009,
> I have attached the sample code.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to