Android的SDK包很大,源碼至少3.5G以上,因此交叉編譯的代碼量也是相當大。 筆者,曾用DELL Latitude E5410(i3機型)Ubuntu實體機(非虛擬機)首次編譯,整整花了10個小時編譯。所以各位,“工慾善其事必先利其器”,推薦使用以下配置:
- CPU:Intel i7-4770。
- RAM:金士頓 16G DDR3-1600。
- HD:西部數據 500G。
1,安裝軟件包,執行
- $ sudo apt-get install openssh-server
ubuntu CD版本缺省安裝openssh-client;如果你的系統沒有安裝的話,那麼請執行下面命令即可。
- $ sudo apt-get install openssh-client
2,然後確認sshserver是否啓動,執行
- $ ps -e |grep ssh
如果只有ssh-agent,那麼說明ssh-server還沒有啓動;如果看到sshd那說明ssh-server已經啓動了。
3,ssh-server配置文件位於/etc/ssh/sshd_config中,使用以下命令參看。
- $ cat /etc/ssh/sshd_config
SSH默認端口是22,可以定義SSH的服務端口,也可以改成其他端口。
4,然後重啓SSH服務
- $ sudo /etc/init.d/ssh restart
5,Windows機上,選用熟悉的遠程登錄工具,設置Ubuntu的IP地址、開放的用戶名和密碼、協議是SSH2、默認端口22,即可。
1,Linux服務器端,可以使用ifconfig命令手動設置服務器的IP,例如:192.168.1.101。2,在遠程登錄軟件中填入IP信息,輸入用戶名和密碼。3,登錄成功。
1,安裝samba服務套件
- $ sudo apt-get install samba
安裝系統設置的共享模塊
- $ sudo apt-get install kdenetwork-filesharing
2,配置samba服務
第一步,創建共享目錄
創建:/home/jack/share。/home/jack/是筆者的服務器的普通用戶的用戶目錄,讀者將jack改爲您使用的目錄即可。
創建share目錄:
- $ mkdir /home/jack/share
第二步,設置目錄的權限設置該文件夾的權限,使新目錄讓所有用戶可讀可寫可執行。如果讀者覺得給目錄全部的權限不妥當,請自行改爲您認爲安全妥當的權限。
- $ chmod -R 0777 /home/jack/share
第三步,備份smb.conf在Linux上修改腳本前,要養成隨時備份的習慣。備份smb.conf文件:
- $ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
第四步,修改smb.conf腳本
- 使用vim修改腳本:
- $ sudo gedit /etc/samba/smb.conf
- 在smb.conf中搜尋這一行文字代碼:
- ; security = user
用下面這幾行取代
- security = user
- username map = /etc/samba/smbusers
- 在smb.conf中增加新用戶new的共享目錄
將下列幾行新增到文件的最後面,新創建允許訪問的用戶爲:new,共享目錄爲 /home/jack/share。
- [Share]
- comment = Shared Folder with username and password
- path = /home/jack/share
- public = yes
- writable = yes
- valid users = new
- create mask = 0700
- directory mask = 0700
- force user = nobody
- force group = nogroup
- available = yes
- browseable = yes
- 增加新用戶的一些其他屬性
找到[global],
將舊屬性
- workgroup = MSHOME
改成 (這裏的WORKGROUP是共享中的工作組名稱):
- workgroup = WORKGROUP
- display charset = UTF-8
- unix charset = UTF-8
- dos charset = cp936
後三行,爲了防止出現中文目錄亂碼的情況。
- 添加新網絡訪問帳戶
添加新的網絡訪問賬戶:new
- $ sudo useradd new
上面只是增加了new這個用戶,卻沒有給用戶賦予本機登錄密碼。所以這個用戶將只能從遠程訪問,不能從本機登錄。而且samba的登錄密碼可以和本機登錄密碼不一樣。
- 新增網絡使用者的帳號
設置new密碼。這個密碼不是開機登錄時候用的,而是訪問Windows共享文件時要填的密碼。
- $ sudo smbpasswd -a new
- 新建/etc/samba/smbusers文件
- $ sudo vim /etc/samba/smbusers
在新建的文件內加入下面行並保存
- new = “network username”
- new用戶的管理
修改new用戶的網絡訪問密碼,使用下行命令:
刪除new這個訪問賬戶,使用下行命令:
- $ sudo smbpasswd -a new
- $ sudo smbpasswd -x new
- 測試samba服務
測試samba服務:
- $ sudo testparm
當你輸入上面的命令的時候有可能會出現“執行子進程“testparm”失敗沒有該文件或目錄”, 這是你要重新輸入命令:
- $ sudo apt-get install samba-common-bin
這個問題就解決了。
- 重新啓動samba服務
輸入重啓命令:
- $ sudo /etc/init.d/smbd restart
到這,samba服務就配置完成。點開你的win下網上鄰居 查看工作組計算機裏面就有共享的samba服務,不過前提是你已經開啓samba服務
- Windows端打開共享目錄
samba服務開啓了,網上鄰居下查看工作組計算機裏面就有共享的samba服務。進入共享目錄,輸入用戶名:new和密碼:xxxxxx。
第五步,整個安裝過程終了。
- 附錄1:主機的詳細配置
- jack-i7
- description: Desktop Computer
- product: All Series (All)
- vendor: ASUS
- version: System Version
- serial: System Serial Number
- width: 64 bits
- capabilities: vsyscall32
- configuration: administrator_password=disabled boot=normal chassis=desktop family=ASUS MB frontpanel_password=disabled keyboard_password=disabled power-on_password=disabled sku=All uuid=E09BCD47-DAD7-DD11-AC19-AC220B83572C
- *-core
- description: Motherboard
- product: B85-PLUS
- vendor: ASUSTeK COMPUTER INC.
- physical id: 0
- version: Rev X.0x
- serial: 130713881100238
- slot: To be filled by O.E.M.
- *-firmware
- description: BIOS
- vendor: American Megatrends Inc.
- physical id: 0
- version: 0602
- date: 07/16/2013
- size: 64KiB
- capacity: 15MiB
- capabilities: pci apm upgrade shadowing cdboot bootselect socketedrom edd int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int9keyboard int14serial int17printer acpi usb biosbootspecification
- *-memory:0 UNCLAIMED
- physical id: 1
- *-bank UNCLAIMED
- description: DIMM DDR3 Synchronous 1600 MHz (0.6 ns)
- product: KHX1600C10D3/8GX
- vendor: Kingston
- physical id: 0
- serial: 18170682
- slot: ChannelA-DIMM0
- size: 8GiB
- width: 64 bits
- clock: 1600MHz (0.6ns)
- *-memory:1
- description: System Memory
- physical id: 42
- slot: System board or motherboard
- *-bank:0
- description: DIMM [empty]
- product: [Empty]
- vendor: [Empty]
- physical id: 0
- serial: [Empty]
- slot: ChannelA-DIMM1
- *-bank:1
- description: DIMM DDR3 Synchronous 1600 MHz (0.6 ns)
- product: KHX1600C10D3/8GX
- vendor: Kingston
- physical id: 1
- serial: 18170682
- slot: ChannelB-DIMM0
- size: 8GiB
- width: 64 bits
- clock: 1600MHz (0.6ns)
- *-bank:2
- description: DIMM [empty]
- product: [Empty]
- vendor: [Empty]
- physical id: 2
- serial: [Empty]
- slot: ChannelB-DIMM1
- *-cache:0
- description: L1 cache
- physical id: 49
- slot: CPU Internal L1
- size: 256KiB
- capacity: 256KiB
- capabilities: internal write-back
- *-cache:1
- description: L2 cache
- physical id: 4a
- slot: CPU Internal L2
- size: 1MiB
- capacity: 1MiB
- capabilities: internal write-back unified
- *-cache:2
- description: L3 cache
- physical id: 4b
- slot: CPU Internal L3
- size: 8MiB
- capacity: 8MiB
- capabilities: internal write-back unified
- *-cpu
- description: CPU
- product: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
- vendor: Intel Corp.
- physical id: 4f
- bus info: cpu@0
- version: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
- slot: SOCKET 1150
- size: 800MHz
- capacity: 3900MHz
- width: 64 bits
- clock: 100MHz
- capabilities: x86-64 fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cpufreq
- configuration: cores=4 enabledcores=4 threads=8
- *-memory:2 UNCLAIMED
- physical id: 2
- *-memory:3 UNCLAIMED
- physical id: 3
- *-pci
- description: Host bridge
- product: 4th Gen Core Processor DRAM Controller
- vendor: Intel Corporation
- physical id: 100
- bus info: pci@0000:00:00.0
- version: 06
- width: 32 bits
- clock: 33MHz
- *-pci:0
- description: PCI bridge
- product: Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller
- vendor: Intel Corporation
- physical id: 1
- bus info: pci@0000:00:01.0
- version: 06
- width: 32 bits
- clock: 33MHz
- capabilities: pci pm msi pciexpress normal_decode bus_master cap_list
- configuration: driver=pcieport
- resources: irq:40
- *-display
- description: VGA compatible controller
- product: Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller
- vendor: Intel Corporation
- physical id: 2
- bus info: pci@0000:00:02.0
- version: 06
- width: 64 bits
- clock: 33MHz
- capabilities: msi pm vga_controller bus_master cap_list rom
- configuration: driver=i915 latency=0
- resources: irq:45 memory:f7800000-f7bfffff memory:e0000000-efffffff ioport:f000(size=64)
- *-usb:0
- description: USB controller
- product: 8 Series/C220 Series Chipset Family USB xHCI
- vendor: Intel Corporation
- physical id: 14
- bus info: pci@0000:00:14.0
- version: 05
- width: 64 bits
- clock: 33MHz
- capabilities: pm msi xhci bus_master cap_list
- configuration: driver=xhci_hcd latency=0
- resources: irq:41 memory:f7d00000-f7d0ffff
- *-communication
- description: Communication controller
- product: 8 Series/C220 Series Chipset Family MEI Controller #1
- vendor: Intel Corporation
- physical id: 16
- bus info: pci@0000:00:16.0
- version: 04
- width: 64 bits
- clock: 33MHz
- capabilities: pm msi bus_master cap_list
- configuration: driver=mei latency=0
- resources: irq:44 memory:f7d1b000-f7d1b00f
- *-usb:1
- description: USB controller
- product: 8 Series/C220 Series Chipset Family USB EHCI #2
- vendor: Intel Corporation
- physical id: 1a
- bus info: pci@0000:00:1a.0
- version: 05
- width: 32 bits
- clock: 33MHz
- capabilities: pm debug ehci bus_master cap_list
- configuration: driver=ehci-pci latency=0
- resources: irq:20 memory:f7d18000-f7d183ff
- *-multimedia
- description: Audio device
- product: 8 Series/C220 Series Chipset High Definition Audio Controller
- vendor: Intel Corporation
- physical id: 1b
- bus info: pci@0000:00:1b.0
- version: 05
- width: 64 bits
- clock: 33MHz
- capabilities: pm msi pciexpress bus_master cap_list
- configuration: driver=snd_hda_intel latency=0
- resources: irq:46 memory:f7d10000-f7d13fff
- *-pci:1
- description: PCI bridge
- product: 8 Series/C220 Series Chipset Family PCI Express Root Port #1
- vendor: Intel Corporation
- physical id: 1c
- bus info: pci@0000:00:1c.0
- version: d5
- width: 32 bits
- clock: 33MHz
- capabilities: pci pciexpress msi pm normal_decode bus_master cap_list
- configuration: driver=pcieport
- resources: irq:16 ioport:2000(size=4096) memory:de200000-de3fffff ioport:de400000(size=2097152)
- *-pci:2
- description: PCI bridge
- product: 8 Series/C220 Series Chipset Family PCI Express Root Port #3
- vendor: Intel Corporation
- physical id: 1c.2
- bus info: pci@0000:00:1c.2
- version: d5
- width: 32 bits
- clock: 33MHz
- capabilities: pci pciexpress msi pm normal_decode bus_master cap_list
- configuration: driver=pcieport
- resources: irq:18 ioport:e000(size=4096) memory:f7c00000-f7cfffff ioport:f0000000(size=1048576)
- *-network
- description: Ethernet interface
- product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
- vendor: Realtek Semiconductor Co., Ltd.
- physical id: 0
- bus info: pci@0000:03:00.0
- logical name: eth0
- version: 0c
- serial: ac:22:0b:83:57:2c
- size: 100Mbit/s
- capacity: 1Gbit/s
- width: 64 bits
- clock: 33MHz
- capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
- configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168g-1_0.0.3 10/23/12 ip=192.168.1.100 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
- resources: irq:43 ioport:e000(size=256) memory:f7c00000-f7c00fff memory:f0000000-f0003fff
- *-pci:3
- description: PCI bridge
- product: 82801 PCI Bridge
- vendor: Intel Corporation
- physical id: 1c.3
- bus info: pci@0000:00:1c.3
- version: d5
- width: 32 bits
- clock: 33MHz
- capabilities: pci pciexpress msi pm subtractive_decode bus_master cap_list
- *-pci
- description: PCI bridge
- product: ASM1083/1085 PCIe to PCI Bridge
- vendor: ASMedia Technology Inc.
- physical id: 0
- bus info: pci@0000:04:00.0
- version: 03
- width: 64 bits
- clock: 33MHz
- capabilities: pci subtractive_decode bus_master cap_list
- resources: iomemory:202001f10-202001f0f
- *-usb:2
- description: USB controller
- product: 8 Series/C220 Series Chipset Family USB EHCI #1
- vendor: Intel Corporation
- physical id: 1d
- bus info: pci@0000:00:1d.0
- version: 05
- width: 32 bits
- clock: 33MHz
- capabilities: pm debug ehci bus_master cap_list
- configuration: driver=ehci-pci latency=0
- resources: irq:23 memory:f7d17000-f7d173ff
- *-isa
- description: ISA bridge
- product: B85 Express LPC Controller
- vendor: Intel Corporation
- physical id: 1f
- bus info: pci@0000:00:1f.0
- version: 05
- width: 32 bits
- clock: 33MHz
- capabilities: isa bus_master cap_list
- configuration: driver=lpc_ich latency=0
- resources: irq:0
- *-storage
- description: SATA controller
- product: 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode]
- vendor: Intel Corporation
- physical id: 1f.2
- bus info: pci@0000:00:1f.2
- version: 05
- width: 32 bits
- clock: 66MHz
- capabilities: storage msi pm ahci_1.0 bus_master cap_list
- configuration: driver=ahci latency=0
- resources: irq:42 ioport:f0b0(size=8) ioport:f0a0(size=4) ioport:f090(size=8) ioport:f080(size=4) ioport:f060(size=32) memory:f7d16000-f7d167ff
- *-serial UNCLAIMED
- description: SMBus
- product: 8 Series/C220 Series Chipset Family SMBus Controller
- vendor: Intel Corporation
- physical id: 1f.3
- bus info: pci@0000:00:1f.3
- version: 05
- width: 64 bits
- clock: 33MHz
- configuration: latency=0
- resources: memory:f7d15000-f7d150ff ioport:f040(size=32)
- *-scsi:0
- physical id: 4
- logical name: scsi2
- capabilities: emulated
- *-disk
- description: ATA Disk
- product: ST500DM002-1BD14
- vendor: Seagate
- physical id: 0.0.0
- bus info: scsi@2:0.0.0
- logical name: /dev/sda
- version: KC48
- serial: W2AWZB7N
- size: 465GiB (500GB)
- capabilities: partitioned partitioned:dos
- configuration: ansiversion=5 signature=0005c4fe
- *-volume:0
- description: EXT4 volume
- vendor: Linux
- physical id: 1
- bus info: scsi@2:0.0.0,1
- logical name: /dev/sda1
- logical name: /
- version: 1.0
- serial: 04260d4f-b5e5-4347-af32-75ea9b2937a5
- size: 450GiB
- capacity: 450GiB
- capabilities: primary bootable journaled extended_attributes large_files huge_files dir_nlink recover extents ext4 ext2 initialized
- configuration: created=2013-09-20 17:52:06 filesystem=ext4 lastmountpoint=/ modified=2013-10-05 22:31:21 mount.fstype=ext4 mount.options=rw,relatime,errors=remount-ro,data=ordered mounted=2013-12-02 10:30:45 state=mounted
- *-volume:1
- description: Extended partition
- physical id: 2
- bus info: scsi@2:0.0.0,2
- logical name: /dev/sda2
- size: 15GiB
- capacity: 15GiB
- capabilities: primary extended partitioned partitioned:extended
- *-logicalvolume
- description: Linux swap / Solaris partition
- physical id: 5
- logical name: /dev/sda5
- capacity: 15GiB
- capabilities: nofs
- *-scsi:1
- physical id: 5
- logical name: scsi3
- capabilities: emulated
- *-cdrom
- description: DVD reader
- product: DVD-E818A9T b
- vendor: ASUS
- physical id: 0.0.0
- bus info: scsi@3:0.0.0
- logical name: /dev/cdrom
- logical name: /dev/dvd
- logical name: /dev/sr0
- version: 1.00
- capabilities: removable audio dvd
- configuration: ansiversion=5 status=nodisc
- *-power UNCLAIMED
- description: To Be Filled By O.E.M.
- product: To Be Filled By O.E.M.
- vendor: To Be Filled By O.E.M.
- physical id: 1
- version: To Be Filled By O.E.M.
- serial: To Be Filled By O.E.M.
- capacity: 32768mWh