default ssh port 更改 - iOS

By Victoria
at 2009-11-25T04:09
at 2009-11-25T04:09
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
--
給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
--
Tags:
iOS
All Comments

By Doris
at 2009-11-26T19:23
at 2009-11-26T19:23

By Harry
at 2009-11-30T21:13
at 2009-11-30T21:13

By Heather
at 2009-12-05T11:39
at 2009-12-05T11:39

By Andy
at 2009-12-09T21:55
at 2009-12-09T21:55

By Irma
at 2009-12-13T10:33
at 2009-12-13T10:33

By Hedda
at 2009-12-17T08:01
at 2009-12-17T08:01

By Skylar Davis
at 2009-12-19T17:53
at 2009-12-19T17:53

By George
at 2009-12-21T08:03
at 2009-12-21T08:03

By Blanche
at 2009-12-22T15:04
at 2009-12-22T15:04
Related Posts
我的Apple生活-SansWord

By Adele
at 2009-11-22T01:24
at 2009-11-22T01:24
我的Apple生活 - johnko1987

By Belly
at 2009-11-21T20:44
at 2009-11-21T20:44
Super KO Boxing (運動 創意)

By Poppy
at 2009-11-21T12:06
at 2009-11-21T12:06
有iPhone的生活

By Puput
at 2009-11-20T18:52
at 2009-11-20T18:52
天氣、行事曆、來電、簡訊待機主題 :P

By Hedy
at 2009-11-20T18:21
at 2009-11-20T18:21