default ssh port 更改 - iOS

Table of Contents

說明:

給JB後安裝ssh的人
前陣子網路上出現 iphone ssh worm
主要是有人沒有把default的 root/mobile 帳號的系統密碼改掉

作法:
ssh 登入到 iphone (可以用 putty,詳細可 google)
如果還沒把密碼改掉的話 root 跟 mobile 帳號的密碼是 alpine
(少部份的密碼也有可能是 dottie)

1) 用 mobile 登入系統後,如果要改密碼
passwd mobile (敲入兩次密碼)
2) su 到 root
su - (敲入root的密碼,default 是 alpine)
3) 改 root 的密碼
passwd root (敲入兩次密碼)
4) 備份兩個設定檔 (/etc/service, /Library/LaunchDaemons/com.openssh.sshd.plist)
cp /etc/service ~/
cp /Library/LaunchDaemons/com.openssh.sshd.plist ~/
5) 更改設定檔
說明:把內鍵 ssh port 從 22 改到 50000 (假設),其實 50000以上的port都可以
a) echo 'pttssh 50000/tcp #Secure sshd port' >> /etc/services
b) 用喜好的軟體(vim, nano)編輯
vim /Library/LaunchDaemons/com.openssh.sshd.plist
尋找 <string>ssh</string>
會有兩個位置 (Sockets/Listeners/Bonjour, SockServiceName)
改為 <string>pttssh</string>
6) 儲存後 reboot

--

All Comments

Doris avatarDoris2009-11-26
感覺好麻煩哦~我只用SBSettings關閉而已! 推教學~
Harry avatarHarry2009-11-30
用sbsetting關掉的方法比較好, 改密碼會有其他問題
Heather avatarHeather2009-12-05
SB的缺點是重開機SSH又會自動打開 每次都要記得關
Andy avatarAndy2009-12-09
改掉會有什麼問題?
Irma avatarIrma2009-12-13
以前的話冬版好像會用到預設密碼 改掉會白蘋果
Hedda avatarHedda2009-12-17
改 port 也許是好方法,不過 cracker 掃 port 應該也不難就
Skylar Davis avatarSkylar Davis2009-12-19
是了....我之前有改過密碼,用 winterboard 沒出什麼問題
George avatarGeorge2009-12-21
OS 3.1.2,不過怕出問題還是改回來,乖乖手動關 SSH :P
Blanche avatarBlanche2009-12-22
體驗美好的記帳生活,從記帳日記開始!