生活随笔
收集整理的這篇文章主要介紹了
Linux Ubuntu如何远程协助Windows
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
一、安裝rdesktop
打開Linux Ubuntu按Ctrl - Alt - T打開終端使用萬能的安裝指令$ sudo apt-get install rdesktop安裝rdesktop使用指令$ rdesktop --help測試rdesktop是否成功安裝
二、設(shè)置Windows
打開Windows右鍵"我的電腦" (好像Win7是"此電腦),選"屬性"
點擊"遠(yuǎn)程設(shè)置"
把有關(guān)的都勾成允許
按Win - R打開"運(yùn)行"輸入cmd打開Windows命令行在命令行中輸入ipconfig查看你的IP地址
找到"以太網(wǎng)適配器 以太網(wǎng):"那一段
找到"IPv4 地址"那一行
把后面那一串?dāng)?shù)字記下來,那是Windows的IP地址
三、使用rdesktop
$ rdesktop IP_address遠(yuǎn)程協(xié)助IP_address,默認(rèn)不全屏 (協(xié)助后屏幕大小不可更改),無聲音$ rdesktop -f IP_address全屏顯示$rdesktop -r attr IP_adress設(shè)置屬性,例:
- $ rdesktop -f -r sound:on IP_address開啟聲音
- $ rdesktop -f -r sound:local IP_address把聲音帶到本地播放器 (須與-r sound:local聯(lián)用,不然沒聲音)
$ rdesktop -u username IP_address使用username作為登錄用戶名$ rdesktop -p password IP_address使用password作為登錄密碼 (如果此項不選且Windows設(shè)置了密碼,那么會顯示出開機(jī)登錄界面,必須使用強(qiáng)密碼,不能用PIN碼)
四、編寫Linux Bash腳本
由于rdesktop每個參數(shù)都很長,一般都會用到如下指令
$ rdesktop -f -u username -p password -r sound:on -r sound:local IP_address
十分繁瑣,所以可以將rdesktop的調(diào)用寫在Bash腳本中腳本內(nèi)容
username
="default_uesrname"
password
="default_password"
declare -i full_screen
=1
declare -i sound_on
=1
declare -i sound_local
=1
ip
="default_ip"
function default
{echo "username\t: $username"echo "password\t: $password"echo "full screen\t: $full_screen"echo "sound\t: $sound_on"echo "sound to local\t: $sound_local"echo "ip:\t $ip"
}
function help
{echo "control [options] [IP_address]"echoecho "options:"echo "\t-d\tshow the default options"echo "\t-f\t(not) show full-screen"echo "\t--help\tshow this help document"echo "\t-l\t(not) bring the sound to local"echo "\t-p <password>\tuse <password> as password"echo "\t-s\t(not) turn on the sound"echo "\t-u <username>\tuse <username> as username"
}echo declare -i mode
=0
declare -i count
=0
for arg
in "$@"
docount
= $count + 1
case $arg in"-d")default
"-f")full_screen
=$full_screen - 1
"--help")help
"-l")sound_local
=$sound_local - 1
"-p")mode
=2*
)case $mode in0
)ip
=$arg1
)username
=$arg2
)password
=$argesac
;;esac
done
instruction
="rdesktop"
instruction
="$instruction -u \"$username\""
instruction
="$instruction -p \"$password\""
if $full_screen;; theninstruction
="$instruction -f"
fi
if $sound_on;; theninstruction
="$instruction -r sound:on"
fi
if $sound_local;; theninstruction
="$instruction -r sound:local"
fi
instruction
="$instruction $ip"
$instruction
exit $?
注:由于最近我的Linux崩潰了,本段代碼無法測試,可能會有小錯誤,請見諒!
總結(jié)
以上是生活随笔為你收集整理的Linux Ubuntu如何远程协助Windows的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。