Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SSH denial with a word
18-06-2011, 01:34 AM, (This post was last modified: 14-08-2011, 04:17 AM by JejakaPemalu.)
Post: #1
SSH denial with a word
Ini tips on how to create denial usage of ssh login certain untuk users dengan ayat tersendiri...
Mula2 masuk kan cmd berikut di terminal..
Code:
cat << EOF >> /usr/bin/gitout
#!/bin/bash
echo "Git over here"!!!
EOF

Code:
chmod +x /usr/bin/gitout

User yg kita tak bagi access ke shell tadi bagi dia shell jadi kepada execution script tadi
Code:
usermod -s /usr/bin/gitout test
skang kalo mamat test ni login ke shell guna ssh ke apa ke akan dapat ayat yg kome wat tadi..

Selamat mencuba
However near and dear you are with wife, children, friends, families they are not you; they are outside of you. The inside of you says who is near. If nothing is said than you are foreveralone. Raise your iman and you shall not be foreveralone.
Reply
18-06-2011, 03:19 AM,
Post: #2
RE: SSH denial with a word
agk krg phm wei...kasi explain detail lg? bleh ke? Smile
[ SHARING IS CARING ] Big Grin [ KNOWLEDGE ARE INFINITY ]
Reply
18-06-2011, 04:14 AM, (This post was last modified: 18-06-2011, 04:17 AM by JejakaPemalu.)
Post: #3
RE: SSH denial with a word
Boleh je...

Objectif:
Menghalang orang lain ssh/login..

Plot Cerita:
Sometimes ssh port ni digunakan kalo mau wat transfer ke apa ke..Slalu aku apply utk git repo on9..so klu sapa mau join aku tak kasi lah ssh privilege..tapi aku tak leh set user tuh kepada /bin/false...sebab nnt dia tak leh nak push or pull...so aku kasi lah dia satu shell yg ada echo aje apa yg aku nak katakan..kalo aku sandbox login pon boleh..tapi watpe dia nak git aje..command shell yg lain tak perlu..

Penerangan procedure:

Code:
cat << EOF >> /usr/bin/gitout
#!/bin/bash
echo "Git over here!!!"
EOF

Sebenarnya sama ngn
Code:
echo -en "#!/bin/bash\necho 'Git over here!!!''" > /usr/bin/gitout

Dimana aku write to file di /usr/bin/gitout 'Git over here!!!'

Yang
Code:
chmod +x /usr/bin/gitout
aku set dia supaya boleh di execute iaitu kalo ikot chmod rwx tuh ia set sume x so if asalnya 640 ia akan jadi 751..tak paham chmod? refer tutor chmod..( nak link tapi tak jumpa plak ).. So bile dah set sebagai can execute nih ia automatically bleh jadi an execution file..atau ini windows .exe

Code:
usermod -s /usr/bin/gitout test
yang nih plak aku set user test nih supaya shell dia hanya execute apa benda aku bg tadi jerr..so kalo dia nak konon2 nya try masuk guna ssh ke address git aku denied with perkataan aku buh tadi..ini screenshoot kalo mamat test ni nak cuba gatai tangan login...



[attachment=400]
p/s: aku penerangan bahasa melayu nih fail skit..ayat berterabur..sori geng..dok obersea lama sgt...
However near and dear you are with wife, children, friends, families they are not you; they are outside of you. The inside of you says who is near. If nothing is said than you are foreveralone. Raise your iman and you shall not be foreveralone.
Reply
10-07-2011, 05:33 PM,
Post: #4
RE: SSH denial with a word
hari ni baru aku faham....hehhehe Big Grin
Rajin Belajar Pasti Berjaya
Tiada Kegagalan Setelah Berusaha
Itulah Cara Membalas Jasa
Pengorbanan Guru Dan Keluarga Tercinta
Big Grin

Spoiler:
[Image: 522167_476797252342999_168490270_n.jpg]
Reply


Forum Jump: