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

SFTP Not working #50

Open
iamaravindragu opened this issue Jul 3, 2024 · 14 comments
Open

SFTP Not working #50

iamaravindragu opened this issue Jul 3, 2024 · 14 comments

Comments

@iamaravindragu
Copy link

Change the shell to sudosh for an user , post that he cant able to do SFTP via WinSCP , any alternative solution available for that ?

--
Aravindan R

@squash
Copy link
Owner

squash commented Jul 3, 2024

You need to allow it with the "-c arg allow" option in sudosh.conf.

@iamaravindragu
Copy link
Author

sudosh conf
error-sftp

Tried :
-c arg allow = SFTP
-c arg allow = SSH

Yeah Tried that as well , Still no luck . But If I changed the shell to normal /bin/bash , SFTP is working well.

--
Aravindan R

@squash
Copy link
Owner

squash commented Jul 3, 2024

case matters, try something like

-c arg allow=/usr/lib/openssh/sftp-server

or whatever the path is on your host.

@iamaravindragu
Copy link
Author

Ok added that in sudosh.conf and result is the same error

@squash
Copy link
Owner

squash commented Jul 4, 2024

what OS and version is your host? I can try to recreate your scenario.

@iamaravindragu
Copy link
Author

OS : Ubuntu 20 VERSION="20.04.6 LTS

@squash
Copy link
Owner

squash commented Jul 4, 2024

This works for me on Ubuntu 20.04:

# Allow Sudosh to execute -c arguments?  If so, what?
-c arg allow = scp
-c arg allow = rsync
-c arg allow = /usr/lib/openssh/sftp-server

@iamaravindragu
Copy link
Author

Have you tried login via WinScp ? I've the same thing in sudosh.conf not able to login .

Aravindan R

@squash
Copy link
Owner

squash commented Jul 4, 2024

I do not have Windows to test WinSCP but I have did test with Filezilla in sftp mode as well as openssh command line.

Make sure sudosh is listed in /etc/shells also.

@iamaravindragu
Copy link
Author

Okay , sudosh was listed in /etc/shells . Seems like Filezilla doesn't support MFA based authentication .

My Set up as like below

Key Based Login ( Which has Password enabled ) + MFA

@squash
Copy link
Owner

squash commented Jul 5, 2024

MFA is likely where your problem is happening, can you share your MFA config for openssh and I can try to set up a test environment?

if it is handing it off to another command, you might also try
-c arg allow = *

@iamaravindragu
Copy link
Author

Key Based Login ( Which has Password enabled ) + MFA is working Normally when I take SSH Session , but when I taken via SFTP(Winscp) things are not working .

MFA -- Google Authentication , Followed the below procedure 
  
      https://www.turbogeek.co.uk/google-authentication-mfa-on-linux/

--
Aravindan R

@squash
Copy link
Owner

squash commented Jul 8, 2024

It may be a bit before i'm able to create this environment, in the mean time please test with the * arg and see if that helps.

@iamaravindragu
Copy link
Author

Ok , tried with below syntax and still no luck

-c arg allow= *

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

No branches or pull requests

2 participants