Tuesday, April 24, 2007

chroot-тэй ssh эсвэл sftp үйлчилгээ хэрхэн нээх вэ?

(энэ бичлэг дуусаагүй бичиж байгаа гэж ойлгоорой)

Юуны өмнө шаардлагыг тодруулъя.

Юникс серверт дагаж суусан байдаг ssh, ftp нь файл зөөх, нийтийн үйлчилгээ гм нээхэд нууцлал хамгаалалт муутай байдаг. Жишээ нь: заавал системийн хэрэглэгч үүсгэнэ, эрхээрээ хандаж орсны дараа бусад хэрэглэгчдийн, системийн директорид хандах боломжтой байдаг. Гэтэл би тэгүүлмээргүй байна. Яг заасан директоридоо л орно, бусад хэсэгт хандах боломжгүй болгомоор байна. Үүнийг нилээн дээр хийг гэж үзээд орхисон байсныг одоо шаардлага тулгарсан тул сэргээн хийе гэж бодож байна.

эхний алхам. мэдээлэл цуглуулах.

FreeBSD Questions ML-ээс

> Using the SSHD server, how can I lock users SSH'ing into a box into their
> home directory, without having access to the /usr/home directory as a
> whole?

You can try to use the security/ssh2 port to replace the base system's
sshd(8). This version of ssh supports additional chroot configuration
options which lets you do exactly what you're looking for.

Here's a link to the port:
http://www.freebsd.org/cgi/url.cgi?ports/security/ssh2/pkg-descr

Here's an article which shows you how to do what your looking for:
http://freebsdrocks.net/index.php?option=com_content&task=view&id=51&Itemid=1

Have fun,

David
-----------------


You might setup 700 rights for the home directories, then the users
won't see each other's files. Is it what you want?

If you want to hide all directories, except their homes, then you are in
trouble. There are some essential files needed to run a "shell". I'm not
sure, but you might be able to use a special shell that does chroot and
makes / the home directory?

If you do not want them to run programs, just access their files over
SSH/SCP, then the "scponlyc" port can be a good solution for you.

Best,

Laszlo
--------------


You could set them up with a restricted shell. Use e.g. 'bash -r' or the
equivalent 'rbash'. See the RESTRICTED SHELL section in the bash manual
to understand what it does.

Roland
--------------


What about creating a jail? Whis wikipedia article explains it ;
http://en.wikipedia.org/wiki/Freebsd_jail

Cheers,
Gabriel
-----------------

google-ээр хайгаад
http://www.maxlor.com/howto-jailed-sftp.shtml -ийг олов.

-------------
wikipedia-аар жоохон аялав.

FTP - нууцлал муутай, та мэдэж байгаа
FTPS - буюу FTP over SSH/TLS нууцлал арай дээр, гэхдээ Дата суваг шифрлэгдээгүй.(SFTP, SH-FTP, FTP/SSH)
SFTP - SSH file transfer protocol. SSH-ийн дэд хэсэг. нууцлал сайн боловч хувийн директорит нь түгждэггүй.
SFTP - Simple File Transfer Protocol нууцлал байхгүй. бараг хэрэглэдэггүй. Дээрхитэй андуурагддаг.
SCP - Secure Copy. Нууцлал сайн боловч SSH2 -ийн SFTP гарч ирснээр ашиглахгүй болсон.

2 comments:

Barilga2015 said...

ubuntu deer yaj chroot hiih be? ta freebsd deer jail ashiglaj hiisen uu?

bmr said...

Тийм ээ, Jail дотор хийсэн.
Убунту дээр хийж байгаагүй байх аа. Гэхдээ Гүүглдээд амархан очих байх.