Setup SFTP server in Windows using OpenSSH with public key authentication, folder jailing

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ม.ค. 2025

ความคิดเห็น • 129

  • @liam9303
    @liam9303 ปีที่แล้ว +9

    Extremely resourceful video, not only you fully explained what to do but you also informed us what everything means. Amazing work and straight to the point.

  • @sean-qo4vc
    @sean-qo4vc ปีที่แล้ว +2

    I have been setting up my Sftp server for a week now and this video has come through I appreciate 🙏

  • @praveenm8059
    @praveenm8059 2 ปีที่แล้ว +7

    Amazing!!!! I was struggling to setup a sftp server for days then came across your video ...
    Very detailed and clear steps👍🔥.
    Thank you

  • @rsingha09
    @rsingha09 7 หลายเดือนก่อน +1

    Thanks!

  • @flaviendarre742
    @flaviendarre742 ปีที่แล้ว +3

    Hey man, very detailed video, i'm planning to use this for a group project in class once i figure how to open my lab to the net, one step you forgot to mention and would seem trivial to someone who deals with this often : restart the openssh services after editing sshd_config, otherwise you're still allowing credentials with or without keys

  • @MikeFlemmer
    @MikeFlemmer ปีที่แล้ว +1

    After watching a lot of others this one got me setup! Very detailed and the instruction guide helped a lot! I had confusion about what name for username but figured it out it's a user profile name on server.

  • @OzasweiTamrakar
    @OzasweiTamrakar ปีที่แล้ว +1

    at 19:30 , after following all the menthods till adding the private key, when I try to connect , It says "Server refused our key". what should i do?

    • @learningsoftwareskills
      @learningsoftwareskills  ปีที่แล้ว

      Hi, the most common cause of "server refused our key" is wrong permissions of the "authorized_keys" file. Please re-check it.
      The issue can also be in syntax errors or invalid username in the sshd_config file.
      Logs of SFTP server can also be seen to easily trace reason for the problem.
      I have also created a video on SFTP server logging at th-cam.com/video/YZwUBqDJFlQ/w-d-xo.html
      Hope this helps, Cheers👍

    • @OzasweiTamrakar
      @OzasweiTamrakar ปีที่แล้ว +1

      @@learningsoftwareskills Thank you, sir, It helped.

    • @learningsoftwareskills
      @learningsoftwareskills  ปีที่แล้ว

      @@OzasweiTamrakar Hi, I am glad you resolved ur issue...👍

    • @Nine-Nine24-7
      @Nine-Nine24-7 ปีที่แล้ว

      Please help , what did you do to resolve the error ?@@OzasweiTamrakar

  • @venkatsaibond007
    @venkatsaibond007 ปีที่แล้ว +1

    A superb way of explaining and nice documentation illustrating each step, Thanks

  • @pragatilotlikar700
    @pragatilotlikar700 2 ปีที่แล้ว +2

    Very thankful to you for the video and the blog...hatsoff to the efforts...really wanted to understand ftp setup and your resources were of great help...👍not just the video but also your method of stepwise explaination is too god...keep making such detailed videos...

  • @Rehees-e1i
    @Rehees-e1i 6 หลายเดือนก่อน +2

    Great video - Explains in detail everything I needed to know - thank you!!

  • @reggie9550
    @reggie9550 ปีที่แล้ว +1

    Very clear steps and great documentation .. thankyou Sir

  • @bereketadmassu8399
    @bereketadmassu8399 ปีที่แล้ว +1

    Very organized and import , please keep up the good work !!!

  • @bereketadmassu8399
    @bereketadmassu8399 ปีที่แล้ว +1

    Very well organized and right to the point exceptional !!!!

  • @aaronenabs1138
    @aaronenabs1138 ปีที่แล้ว +2

    great video - only question I have about folder jailing is how can i setup multiple SFTP usernames to jail to different folders @learning software

    • @learningsoftwareskills
      @learningsoftwareskills  ปีที่แล้ว

      Hi, it's really simple. Create a new windows user and setup SFTP and folder jailing.
      Hope this helps, cheers 👍

  • @ricardocbueno
    @ricardocbueno หลายเดือนก่อน +1

    You helped me a lot!!!! thank you so much, extremely useful vídeo!

  • @xtwist3779
    @xtwist3779 8 หลายเดือนก่อน +2

    how to configurate that to login using ssh putty ?

    • @learningsoftwareskills
      @learningsoftwareskills  8 หลายเดือนก่อน

      Hi, just like winscp you can configure putty for ssh. But in this video, we have configured sshd_config to accept only sftp connections and reject ssh connections.
      Hope this helps, cheers 👍

  • @ThiHuyenTrangVo-y2q
    @ThiHuyenTrangVo-y2q ปีที่แล้ว +1

    Thank you so much!! Save one point! But, after change ssh_config file, you need to restart OpenSSH on Services

  • @souravbiswas-tk3se
    @souravbiswas-tk3se ปีที่แล้ว +1

    Thank you.....Full of Information.....Awesome.....

  • @somamehra2996
    @somamehra2996 6 หลายเดือนก่อน +1

    Hey, thanks a lot for tutorial but I’m unable to find sshd_config file under Program Data.. Its a client machine.. Can we create manually?

    • @learningsoftwareskills
      @learningsoftwareskills  6 หลายเดือนก่อน

      Hi the program data ssh folder should not be empty actually. Please check if the openssh server is running. Also please see the openssh server windows logs if possible

  • @afsaralam6201
    @afsaralam6201 2 ปีที่แล้ว +2

    Hi,
    If after following provided step and your are still not able to connect through a third party app then please upgrade the ftp client.
    For me I was facing authentication error for Filezilla and WinScp client bot.
    I upgrade to Filezilla 3.60.2 and for WinScp 5.21.3 and it worked.
    🙂

    • @learningsoftwareskills
      @learningsoftwareskills  2 ปีที่แล้ว +2

      Wow, thanks for sharing your insights. It might be useful for others, Cheers 👍

  • @Nine-Nine24-7
    @Nine-Nine24-7 ปีที่แล้ว

    Please assist am getting server refused our key error , when i check server logs sshd: Connection closed by authenticating user user ::1 port 50962 [preauth] . am only ably to log through password auth only but it's refusing keys

  • @networkstar30
    @networkstar30 ปีที่แล้ว +1

    Please help i created a self signed certificate. and ftp as my file protocol. encryption: tls/ssh implicit encryption. however when connecting and and logging in passpharese for client certification. i always incounter error stating:: No connection could be made because the target machine actively refused it.
    Connection failed.

    • @learningsoftwareskills
      @learningsoftwareskills  ปีที่แล้ว

      Hi, this video is about SFTP but not FTP. Please make sure you are setting up SFTP and not FTP. In case of errors in SFTP server, you can see the SFTP logs in windows event viewer to debug the issue. I have also made a video on this at th-cam.com/video/YZwUBqDJFlQ/w-d-xo.html
      Hope this helps, cheers 👍

  • @Mrbibi38
    @Mrbibi38 6 หลายเดือนก่อน +1

    Followed all the steps correctly but I have this error when I try to connect in sftp : FATAL ERROR: No supported authentication methods available (server sent: publickey,keyboard-interactive)
    The pub key is well added in C:\Users\\.ssh\authorized_keys file...

    • @learningsoftwareskills
      @learningsoftwareskills  6 หลายเดือนก่อน

      Hi, were you trying password authentication or public key authentication?
      In case of password authentication, 'PasswordAuthentication yes' should be present in the sshd_config file of the server

  • @thomaskoipuram
    @thomaskoipuram ปีที่แล้ว +1

    Very useful! Thanks for the detailed video.

  • @arunpothana2923
    @arunpothana2923 ปีที่แล้ว

    Hi
    When i tried to Change the access control list (ACL) of the authorized_keys file in SFTP server. Its showing me Failed processing 1 files. Can you please help me on this?

  • @cop6483
    @cop6483 ปีที่แล้ว +1

    Great Explanation!!! Thank you

  • @DistrictGentleman
    @DistrictGentleman ปีที่แล้ว +1

    This helped me out so much! Thank you!!!!!

  • @karthiksaravanan2993
    @karthiksaravanan2993 ปีที่แล้ว +1

    pls help how to add more chroot directory for one user .

  • @AmitKumar-wv8yh
    @AmitKumar-wv8yh ปีที่แล้ว +1

    I have configured SFTP server on my win 2022 OS...on same server I'm able to connect using localhost....but when I'm trying to connect from my laptop using public IP of server...I'm unable to connect SFTP....(I have allowed port 22 on server's security group)...can help me know what can be the reason?

    • @learningsoftwareskills
      @learningsoftwareskills  ปีที่แล้ว

      Hi, most probably the request would not have been reaching the SFTP server due to some firewall policy issues. You can check the SFTP server logs if the request is reaching the SFTP server. I have made a video on how to see SFTP server logs at th-cam.com/video/YZwUBqDJFlQ/w-d-xo.htmlsi=zQ3IHuTI-AkqIfgV
      Hope this helps, cheers👍

  • @zackmx1
    @zackmx1 ปีที่แล้ว +1

    Make sure your sshd_config file is identical to his. I had a line:
    "# Match Group administrators
    # AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys"
    that broke things as I was trying to login as an admin user and the server was looking for the public key in that directory instead of User/.ssh. I just commented that out and it worked.

  • @magabiwamunyima1029
    @magabiwamunyima1029 3 หลายเดือนก่อน +1

    Question now that user is step up for sftp is there a way to configure for SSH also

    • @learningsoftwareskills
      @learningsoftwareskills  3 หลายเดือนก่อน

      Yes, you can configure ssh also using openssh. We did not cover that in this video. But using the sshd_config file, it is possible

    • @magabiwamunyima1029
      @magabiwamunyima1029 3 หลายเดือนก่อน

      @@learningsoftwareskills thanks I'll try and do some research

  • @TroMpeT1307
    @TroMpeT1307 2 ปีที่แล้ว +1

    I keep getting a server refused key error when i try to log in im not sure if the username is incorrect or the key file is not located im lost

    • @learningsoftwareskills
      @learningsoftwareskills  2 ปีที่แล้ว

      Hi, just see the logs in windows event viewer. Expand the left menu items to find an Event facility named Operational under the OpenSSH menu. I have also created a blog on how to see openssh logs at nagasudhir.blogspot.com/2022/10/setup-logging-for-sftp-server-in-windows.html. Most probably it would be wrong access rights to the SFTP hosted folder.
      Hope this helps, Cheers👍

  • @42Faites
    @42Faites ปีที่แล้ว +1

    After doing this, my OpenSSH service will not start and gets an error message of "Error 1067: The process terminated unexpectedly". It worked before I followed these steps. I uninstalled OpenSSH and reinstalled it, but that didn't help. Any suggestions?

    • @42Faites
      @42Faites ปีที่แล้ว +1

      Never mind, I figured it out. In the sshd_config file, I put in 2 "Match User" commands and the system did not seem to like that for some reason. Removing one of the commands fixed the issue.

  • @marmar4715
    @marmar4715 9 หลายเดือนก่อน +1

    This was really good. Thank you!

  • @jackt6112
    @jackt6112 ปีที่แล้ว +1

    1. Can I use SFTP from another computer while someone else is using RDP?
    2. Can more than one user SFTP into the same server at the same time?

    • @learningsoftwareskills
      @learningsoftwareskills  ปีที่แล้ว

      Hi, you can use SFTP while someone else is using RDP, since both are independent.
      More than one user can SFTP into the same server.
      You can even create multiple user accounts and they can access SFTP server simultaneously. In fact, I have made a video on this topic at th-cam.com/video/G0AE4MmRSJI/w-d-xo.html
      Hope this helps, Cheers👍

    • @jackt6112
      @jackt6112 ปีที่แล้ว

      @@learningsoftwareskills Sounds good. I've never tried to use a Windows Workstation as a server before and my experience is with UNIX where of course they could care less how many log in. Thanks!

  • @sebastienreynier9006
    @sebastienreynier9006 2 ปีที่แล้ว +1

    Hi, thanks a lot for that video that help me solved a "server refused our key" problem after searching for days ! I still have one issue that I cannot solve thgouh, folder jailing does not work...

    • @learningsoftwareskills
      @learningsoftwareskills  2 ปีที่แล้ว

      Hi, thanks for such an awesome feedback. Please mail the sshd_config file to learningsoftwareskills@gmail.com so that can I check it
      Hope this helps, Cheers👍

  • @mark7166
    @mark7166 2 ปีที่แล้ว +1

    I followed the steps, but my server is refusing the private key provided by WinSCP. It's the same private key we generated on the server, correct? Like, I would just copy the private key from the server to the .ssh folder on my own laptop, and import that into WinSCP?

  • @VenkataRatnamNayineni
    @VenkataRatnamNayineni 3 หลายเดือนก่อน +1

    Excellent tutorial

  • @annihilarghgamings8276
    @annihilarghgamings8276 ปีที่แล้ว +1

    Hi brother, one doubt folder jailing is available when you are installing from github but it is not available when we install from windows features right?

    • @learningsoftwareskills
      @learningsoftwareskills  ปีที่แล้ว

      Hi, folder jailing should be available when using windows OS SFTP server also. Cheers 👍

  • @kowalskes9036
    @kowalskes9036 ปีที่แล้ว +1

    Will i be able to login this sftp server from a linux box?

  • @tennysonwhales9289
    @tennysonwhales9289 2 ปีที่แล้ว +1

    I need some help with this. I follow the step but still having a problem

    • @learningsoftwareskills
      @learningsoftwareskills  2 ปีที่แล้ว

      Hi, please see the blogpost for this video at nagasudhir.blogspot.com/2022/03/setup-sftp-server-and-sftp-client-in.html
      You can drop a mail at learningsoftwareskills@gmail.com. I can try to help.
      Hope this helps 👍

  • @hemantverma635
    @hemantverma635 ปีที่แล้ว +1

    in the existing setup, What if I change the domain would it work?

    • @learningsoftwareskills
      @learningsoftwareskills  ปีที่แล้ว +1

      Hi, if you want to specify a user say "abcd" of a domain say "domain1" in the sshd_config file, you can write something like "Match User domain1\abcd"
      While connecting in WinSCP, you have to write the username as "abcd@domain1"
      While connecting through the command line, you have to write "sftp abcd@domain1@hostip"
      Further documentation can be found in the official OpenSSH github docs at github.com/PowerShell/Win32-OpenSSH/wiki/sshd_config
      Hope this helps
      I have also learned something new while trying to solve for this query
      Cheers👍

    • @hemantverma635
      @hemantverma635 ปีที่แล้ว +1

      @@learningsoftwareskills yeah, i was migrating domain on ssh server.. and dont have perfect strategy... Still searching the solution.. will try as you suggested.. thanks..

  • @networkstar30
    @networkstar30 ปีที่แล้ว +1

    Is this 100% secured??? even accessing it on public ip?? please advice?

    • @learningsoftwareskills
      @learningsoftwareskills  ปีที่แล้ว

      Hi, this is openssh. So I think it should be secure in public IP also. Make the ssh configuration proper and use public key authentication. It should be fine for public hosting. Also make sure that only SFTP is accessible and ssh access is restricted as shown in the video.
      Hope this helps, cheers 👍

  • @noahbright9589
    @noahbright9589 ปีที่แล้ว +1

    Hi,
    Thank you for the Video, that was an Awesome Explanation. Still, I am facing a server refused our key problem. could you please help me on that.

    • @learningsoftwareskills
      @learningsoftwareskills  ปีที่แล้ว

      Hi, this can be due to some file permissions issues. Please see the SFTP server logs to know what went wrong.
      Please see this video on how to see SFTP logs th-cam.com/video/YZwUBqDJFlQ/w-d-xo.html
      Hope this helps, cheers 👍

  • @nero1824
    @nero1824 11 หลายเดือนก่อน

    i dont know if you would get this but i am not getting the "Restrict user to a folder (also called folder jailing)" its not restricting client to a folder

    • @learningsoftwareskills
      @learningsoftwareskills  10 หลายเดือนก่อน

      Hi please mail me the sshd_config file to learningsoftwareskills@gmail.com so that we can take a look at the configuration...

    • @nero1824
      @nero1824 10 หลายเดือนก่อน

      @@learningsoftwareskills Hi have sent you the email. thank you

  • @MrJaMKat
    @MrJaMKat 2 ปีที่แล้ว +1

    Great Vid. Thanks for posting. When I try to connect to the SFTP server I get this error from WINSCP - "Cannot initialize SFTP protocol. Is the host running an SFTP server?". Any ideas why?

    • @MrJaMKat
      @MrJaMKat 2 ปีที่แล้ว +1

      I've also tried it in FileZilla and it does connect briefly, but then disconnects immediately with an error. Is there a second layer of authentication happening somewhere I've missed?

    • @learningsoftwareskills
      @learningsoftwareskills  2 ปีที่แล้ว

      @@MrJaMKat hi, it is a good idea that you have tried with filezilla to check the connectivity. Even if filezilla is unable to connect, I think it might be due to some firewall stopping the traffic. If possible please analyse if firewall is stopping the traffic. Also please re-verify if you have setup the SFTP server correctly
      Hope this helps, Cheers 👍

  • @sudhakarchava7753
    @sudhakarchava7753 2 ปีที่แล้ว +2

    excellent. it covered all the points

  • @vadonly
    @vadonly 2 ปีที่แล้ว +1

    Public and private keys are created on sftp server or sftp client ?

    • @learningsoftwareskills
      @learningsoftwareskills  2 ปีที่แล้ว +1

      Hi, public and private keys should be generated on the server and only client and server should know the private key, any other person should not have access to private key, cheers 👍

  • @paraskumar5663
    @paraskumar5663 2 ปีที่แล้ว +1

    Hello. I am using password based authentication. While connecting via WinSCP i am getting this error - cannot initialize FTP protocol. Is the host running a SFP server ? But I can connect via putty. Any idea why WinSCP is not working ? Thanks.

    • @learningsoftwareskills
      @learningsoftwareskills  2 ปีที่แล้ว

      Hi, you are trying to connect with ftp protocol instead of SFTP. While entering the connection details, change the drop-down to SFTP instead of FTP.
      Hope this helps, Cheers 👍

    • @paraskumar5663
      @paraskumar5663 2 ปีที่แล้ว +1

      @@learningsoftwareskills I am definitely using SFTP as the protocol.

    • @learningsoftwareskills
      @learningsoftwareskills  2 ปีที่แล้ว

      @@paraskumar5663 hi, please check if the port is 22

    • @paraskumar5663
      @paraskumar5663 2 ปีที่แล้ว +1

      @@learningsoftwareskills Port is 22. I can connect via putty.

    • @learningsoftwareskills
      @learningsoftwareskills  2 ปีที่แล้ว

      @@paraskumar5663 hi, did you keep the host as localhost. Please send me an image of the SFTP settings to learningsoftwareskills@gmail.com. let me see if i can help
      Cheers 👍

  • @aguiremedia
    @aguiremedia 2 ปีที่แล้ว +1

    How are we able to remote access with this method?

    • @learningsoftwareskills
      @learningsoftwareskills  2 ปีที่แล้ว

      Hi, the method in this video was about accessing a remote folder via sftp using openssh in windows. Remote access of the system would be via SSH but not SFTP
      Hope this helps, Cheers 👍

    • @learningsoftwareskills
      @learningsoftwareskills  2 ปีที่แล้ว

      But, openssh can also be used for remote access via SSH also. See this article for more details learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui
      Cheers 👍

  • @felipemachado9141
    @felipemachado9141 2 ปีที่แล้ว +2

    Great video! Is it possible to make a setup SFTP server in Linux?

    • @learningsoftwareskills
      @learningsoftwareskills  2 ปีที่แล้ว +1

      Hi, thanks for your encouraging feedback.
      Setting up SFTP server in Linux is easier than in windows.
      You can find some help in the following links
      linuxconfig.org/how-to-setup-sftp-server-on-ubuntu-20-04-focal-fossa-linux
      linuxhint.com/setup-sftp-server-ubuntu/

  • @AnhMinh-tx8vh
    @AnhMinh-tx8vh 9 หลายเดือนก่อน +1

    Good Guy! Thank you! 😀

  • @ankurpathaniapathania9058
    @ankurpathaniapathania9058 ปีที่แล้ว +1

    ZABARDAST ZINDABAD 👍

  • @YogaPetz
    @YogaPetz 2 หลายเดือนก่อน

    Hi the SSH SFTP is working from WinSCP Client but when connecting from a web (SAP Cloud COnnector) to SFTP server it it is not working, the permissions are set on the folder level but SAP WEB GUI not able to connect download or upload files Any idea?
    Ref: th-cam.com/video/EFFN35F4mmw/w-d-xo.htmlfeature=shared&t=759

  • @AdityaMaheshKolekar
    @AdityaMaheshKolekar ปีที่แล้ว +1

    server refused our key

    • @learningsoftwareskills
      @learningsoftwareskills  ปีที่แล้ว

      Hi, the most common cause of "server refused our key" is wrong permissions of the "authorized_keys" file. Please re-check it.
      The issue can also be in syntax errors or invalid username in the sshd_config file.
      Logs of SFTP server can also be seen to easily trace reason for the problem.
      I have also created a video on SFTP server logging at th-cam.com/video/YZwUBqDJFlQ/w-d-xo.html
      Hope this helps, Cheers👍

    • @AdityaMaheshKolekar
      @AdityaMaheshKolekar ปีที่แล้ว +1

      @@learningsoftwareskills error resolved thank you . but can you tell me where I can found my computer password ?. Also Your all videos are amazing !!

    • @learningsoftwareskills
      @learningsoftwareskills  ปีที่แล้ว +1

      @@AdityaMaheshKolekar hi, I think you can reset the password but cannot view it.
      Thanks for the encouraging comments. Cheers 👍

  • @fabiomartin7782
    @fabiomartin7782 ปีที่แล้ว +1

    Thanks
    👍

  • @itsarg
    @itsarg ปีที่แล้ว

    absolutely amazing video very helpful, but i am still having a little problem in jalling if u have a discord and can help me if u have time, no probs if u can't.

    • @learningsoftwareskills
      @learningsoftwareskills  ปีที่แล้ว

      Hi, you can mail me at learningsoftwareskills@gmail.com
      Cheers 👍

  • @oussamadoudi1284
    @oussamadoudi1284 ปีที่แล้ว +1