Published on Sake.in.th (https://sake.in.th)

หน้าแรก > หน้าหลัก > ตั้งให้ User สามารถ SFTP ได้อย่างเดียว บน FreeBSD

ตั้งให้ User สามารถ SFTP ได้อย่างเดียว บน FreeBSD [1]

เขียนโดย sake [2] เมื่อ 2008-07-28 15:04

ปกติ เมื่อเมื่อสร้าง user เราสามารถกำหนด shell ให้กับผู้ใช้ได้
ในกรณีที่เราอยากให้ผู้ใช้ สามารถ SFTP ได้อย่างเดียวสำหรับ Web User
มีหลายวิธี หนึ่งในนั้นคือ กำหนดให้ใช้ scponly ซึ่งเป็น restricted shell
ให้ใช้ scp / sftp อย่างเดียว

  1. # cd /usr/ports/shell/scponly
  2. # make install clean

จากนั้น เปลี่ยน shell ของผู้ใช้

  1. # pw user mod username -s /usr/local/bin/scponly

เมื่อ login ผ่าน ssh ผู้ใช้จะไม่สามารถพิมพ์คำสั่งได้

Tags: 
server [3]
freebsd [4]
sftp [5]

Source URL (modified on 2008-07-28 15:04): https://sake.in.th/node/60

Links
[1] https://sake.in.th/blog/%E0%B8%95%E0%B8%B1%E0%B9%89%E0%B8%87%E0%B9%83%E0%B8%AB%E0%B9%89-user-%E0%B8%AA%E0%B8%B2%E0%B8%A1%E0%B8%B2%E0%B8%A3%E0%B8%96-sftp-%E0%B9%84%E0%B8%94%E0%B9%89%E0%B8%AD%E0%B8%A2%E0%B9%88%E0%B8%B2%E0%B8%87%E0%B9%80%E0%B8%94%E0%B8%B5%E0%B8%A2%E0%B8%A7-%E0%B8%9A%E0%B8%99-freebsd
[2] https://sake.in.th/users/sake
[3] https://sake.in.th/tags/sitetags/server
[4] https://sake.in.th/tags/sitetags/freebsd
[5] https://sake.in.th/tags/sitetags/sftp