用java远程控制linux 想用java做个远程管理的程序功能:能让远程的计算机(linux系统)关机、或重新启动不需要填写用户名密码这些信息比如:输入192.168.0.1 点击关机按钮,远程的计算机就关机了谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 应该可以的。看到过一款这样的软件,好像是applet嵌入的。不过一定要输入用户名密码,否则怎么取得权限 做做梦没什么不好 heaker就是这样 b/s c/s的都可以,只是要写两个类,一个发送,一个接受接受到的类就直接运行关机命令就可以了,这个没什么难度。 VNC是java写的一个远程桌面程序,比较强大。 java远程控制linux 安装前的准备 把原先的wine卸载掉.rh7.3有wine和wine-devel两个文件,先卸载掉第二个,然后再卸载第一个,如果你更好的想玩游戏,把OPENGL也升级一下,freetype不用升级了,rh7.3自带的就可以满足汉字的支持了 把你的C盘挂接在linux下 建立目录来挂接 c盘 mkdir /winc 挂接C盘 mount /dev/hda1 /winc 下载wine的最新版到/wind http://www.winehq.com上边有它的最新版 wine-20020804.tar.gz 以普通用户登录linux,把wine-20020804.tar.gz拷贝到/tmp目录下 进入/tmp目录 shell>cd /tmp 解压wine shell>tar vfzx wine-20020804.tar.gz 进入解压后的目录 shell>cd wine-20020804 用wine的安装工具进行安装 shell>./tools/wineinstall 然后就是漫长的等待, 在安装过程中它要你回答yes/no,你选择yes就可以了 wine自动搜索windows的目录的,等你你编译完了,它要让你输入root的密码进入安装 这是就快安装完了,如果安装成功,就会有good lucky的提示 在shell下运行wine,第一次运行不成攻,这是正常,因为没有在/root/.wine/config文件里配置好.找到这些把 [Drive C] "Path" = "/usr/share/win_c" "Type" = "hd" "Label" = "MS-DOS" "Filesystem" = "win95" 改为:[Drive C] "Path" = "/winc" "Type" = "hd" "Label" = "MS-DOS" "Filesystem" = "win95" 就可以了,如果你安装了simsun字体.wine默认就会找到这个字体的 下边就是我的/root/.wine/config WINE REGISTRY Version 2 ;; All keys relative to \\Machine\\Software\\Wine\\Wine\\Config ;; ;; MS-DOS drives configuration ;; ;; Each section has the following format: ;; [Drive X] ;; "Path"="xxx" (Unix path for drive root) ;; "Type"="xxx" (supported types are ‘floppy‘, ‘hd‘, ‘cdrom‘ and ‘network‘) ;; "Label"="xxx" (drive label, at most 11 characters) ;; "Serial"="xxx" (serial number, 8 characters hexadecimal number) ;; "Filesystem"="xxx" (supported types are ‘msdos‘/‘dos‘/‘fat‘, ‘win95‘/‘vfat‘, ‘unix‘) ;; This is the FS Wine is supposed to emulate on a certain ;; directory structure. ;; Recommended: ;; - "win95" for ext2fs, VFAT and FAT32 ;; - "msdos" for FAT16 (ugly, upgrading to VFAT driver strongly recommended) ;; DON‘T use "unix" unless you intend to port programs using Winelib ! ;; "Device"="/dev/xx" (only if you want to allow raw device access) ;; [Drive A] "Path" = "/mnt/floppy" "Type" = "floppy" "Label" = "Floppy" "Serial" = "87654321" "Device" = "/dev/fd0" [Drive C] "Path" = "/winc" "Type" = "hd" "Label" = "MS-DOS" "Filesystem" = "win95" [Drive D] "Path" = "/mnt/cdrom" "Type" = "cdrom" "Label" = "CD-Rom" "Filesystem" = "win95" ; make sure that device is correct and has proper permissions ! "Device" = "/dev/cdrom" [Drive E] "Path" = "/tmp" "Type" = "hd" "Label" = "Tmp Drive" "Filesystem" = "win95" [Drive F] "Path" = "${HOME}" "Type" = "network" "Label" = "Home" "Filesystem" = "win95" [Drive Z] "Path" = "/" "Type" = "network" "Label" = "Root" "Filesystem" = "win95" [wine] "Windows" = "c:\\windows" "System" = "c:\\windows\\system" "Temp" = "e:\\" "Path" = "c:\\windows;c:\\windows\\system;e:\\;e:\\test;f:\\" "Profile" = "c:\\windows\\Profiles\\Administrator" "GraphicsDriver" = "x11drv" ; Wine doesn‘t pass directory symlinks to Windows programs by default. ; Enabling this may crash some programs that do recursive lookups of a whole ; subdir tree in case of a symlink pointing back to itself. ;"ShowDirSymlinks" = "1" "ShellLinker" = "wineshelllink" # <wineconf> [DllDefaults] ; "EXTRA_LD_LIBRARY_PATH" = "${HOME}/wine/cvs/lib" "DefaultLoadOrder" = "native, builtin, so" [DllOverrides] "commdlg" = "builtin, native" "comdlg32" = "builtin, native" "ver" = "builtin, native" "version" = "builtin, native" "shell" = "builtin, native" "shell32" = "builtin, native" "lzexpand" = "builtin, native" "lz32" = "builtin, native" "comctl32" = "builtin, native" "commctrl" = "builtin, native" "wsock32" = "builtin" "winsock" = "builtin" "advapi32" = "builtin, native" "crtdll" = "builtin, native" "mpr" = "builtin, native" "winspool.drv" = "builtin, native" "ddraw" = "builtin, native" "dinput" = "builtin, native" "dsound" = "builtin, native" "mmsystem" = "builtin" "winmm" = "builtin" "msvcrt" = "native, builtin" "msvideo" = "builtin, native" "msvfw32" = "builtin, native" "mcicda.drv" = "builtin, native" "mciseq.drv" = "builtin, native" "mciwave.drv" = "builtin, native" "mciavi.drv" = "native, builtin" "mcianim.drv" = "native, builtin" "msacm.drv" = "builtin, native" "msacm" = "builtin, native" "msacm32" = "builtin, native" "midimap.drv" = "builtin, native" "wnaspi32" = "builtin" "icmp" = "builtin" [x11drv] ; Number of colors to allocate from the system palette "AllocSystemColors" = "100" ; Use a private color map "PrivateColorMap" = "N" ; Favor correctness over speed in some graphics operations "PerfectGraphics" = "N" ; Color depth to use on multi-depth screens ;;"ScreenDepth" = "16" ; Name of X11 display to use ;;"Display" = ":0.0" ; Allow the window manager to manage created windows "Managed" = "N" ; Use a desktop window of 640x480 for Wine ;"Desktop" = "640x480" ; Use XFree86 DGA extension if present "UseDGA" = "Y" ; Use XShm extension if present "UseXShm" = "Y" ; Enable DirectX mouse grab "DXGrab" = "N" ; Create the desktop window with a double-buffered visual ; (useful to play OpenGL games) "DesktopDoubleBuffered" = "N" ; Code page used for captions in managed mode ; 0 means default ANSI code page (CP_ACP == 0) "TextCP" = "0" ; Use this if you have more than one port for video on your setup ; (Wine uses for now the first ‘input image‘ it finds). ;; "XVideoPort" = "43" [fonts] ;Read documentation/fonts before adding aliases "Resolution" = "96" "Default" = "-misc-simsun-" [serialports] "Com1" = "/dev/ttyS0" "Com2" = "/dev/ttyS1" "Com3" = "/dev/ttyS2" "Com4" = "/dev/modem" [parallelports] "Lpt1" = "/dev/lp0" [spooler] "LPT1:" = "|lpr" ;"LPT2:" = "|gs -sDEVICE=bj200 -sOutputFile=/tmp/fred -q -" ;"LPT3:" = "/dev/lp3" [ports] ;"read" = "0x779,0x379,0x280-0x2a0" ; "write" = "0x779,0x379,0x280-0x2a0" [spy] "Exclude" = "WM_SIZE;WM_TIMER;" [registry] ;These are all booleans. Y/y/T/t/1 are true, N/n/F/f/0 are false. ;Defaults are read all, write to Home ; Global registries (stored in /etc) "LoadGlobalRegistryFiles" = "Y" ; Home registries (stored in ~user/.wine/) "LoadHomeRegistryFiles" = "Y" ; Load Windows registries from the Windows directory "LoadWindowsRegistryFiles" = "Y" ; TRY to write all changes to home registries "WritetoHomeRegistryFiles" = "Y" ; Registry periodic save timeout in seconds ; "PeriodicSave" = "600" ; Save only modified keys "SaveOnlyUpdatedKeys" = "Y" [Tweak.Layout] ;; supported styles are ‘Win31‘(default), ‘Win95‘, ‘Win98‘ "WineLook" = "Win98" [Console] ;"Drivers" = "tty" ;"XtermProg" = "nxterm" ;"InitialRows" = "25" ;"InitialColumns" = "80" ;"TerminalType" = "nxterm" [Clipboard] "ClearAllSelections" = "0" "PersistentSelection" = "1" # </wineconf> 可惜支持的速度很慢,我也就没用它来实验运行终端,大家有兴趣可以测试看看。 现在的问题很明显那就是安装JAVA的插件。呵呵跟我来吧: 地址:http://java.sun.com 我下载的是较新的版本,后缀为bin的文件,文件名为: j2sdk-1_4_0-linux-i386-rpm.bin 安装过程: 将该文件拷贝到/tmp目录下 ----//注:cp j2sdk-1_4_0-linux-i386-rpm.bin /tmp 然后执行该文件 ----//注: ./j2sdk-1_4_0-linux-i386-rpm.bin ----//注 注意/前面有个点"." 会出现一些信息显示,先按空格跳过信息显示到询问你同 意否?按Y,然后回车确定就可以了,这样会生成一个rpm文 件在当前目录下 运行rpm文件 ----//注:rpm -Uivh j2sdk-1_4_0-fcs-linux-i386.rpm [设置JAVA环境变量] 用Advanced Editor编辑profile文件 ----//注:该文件在/etc目录下 在最后面加入如下内容: export PATH=/usr/java/j2sdk1.4.0/bin:$PATH export CLASSPATH=.:/usr/java/j2sdk1.4.0/lib/tools.jar:/usr/java/j2sdk1.4.0/lib:$CLASSPATH 存盘退出(不同版本的路径会有所不同,请根据自己实际 情况更改) 然后要让他生效,在命令行中敲打如下命令 ----//注:source /etc/profile 如果希望其他用户可以使用java,用其他用户帐号登录, 然后在命令行下敲打如上的命令 ----//注:source /etc/profile 这些工作做完后用如下命令测试一下 ----//注:which java(显示出来相关信息就可以了) [浏览器支持JAVA问题] 前提是你已经安装了javaVM,并且配置好了环境变量 在Konqueror Webbrowsing中: JAVA设置:在control center(控制中心) > web browsing(页面浏览), 点击konqueror browser(konqueror浏览器),在JAVA选项卡 中"全局启用JAVA"打上勾,然后应用退出. 在Mozilla Webbrowsing中: 进入mozilla的plugin目录下,将JRE的的一个插件文 件链接到mozilla的plugin目录下 (官方站点上的文章说绝对不能拷贝这个文件到该目录 下,只能链接,以前我就是在这点上犯了错误,所以怎么 做都是退出浏览器,切记!!) ----//注:在命令行下(root权限), ----//注:cd /usr/share/mozilla/plugins ----//注:ln -s /usr/java/j2sdk1.4.0/jre/plugins/i386/ns610/libjavaplugin_oji14.so libjavaplugin_oji14.so 现在从新打开新的窗口,在http://ip:5800,看看,OK,出来拉看到拉久违的那个CTL +ALT+DEL按键,好拉下面的就是隐藏图表,进程的问题,图表可以修改注册表,进程 可以用一些注入进程等技术,具体自己去搜索一下,很多的。 好像不是很複雜啊.實在不行用ssh. JAVA中的异常 "AWT-EventQueue-0" ArrayIndexOutOfBoundsException SWING做的界面白屏的问题 回车事件 关于Syncronized继承问题 初学JAVA 有个地方不太理解 就是定义方法的是时候 如何将java客户端程序写成windows服务,可随系统自动启动? jdbTable中如何插入空行? 想把jbuilder7 enterprise trial在linux里安装。 **在线等待**,怎样实现鼠标提示信息 JBUILDER 6 FOR LINUX 的注册码谁有啊 java 调用命令行(在线等) 关于java读取 小语种字符的问题
看到过一款这样的软件,好像是applet嵌入的。
不过一定要输入用户名密码,否则怎么取得权限
安装前的准备 把原先的wine卸载掉.rh7.3有wine和wine-devel两个文件,先卸载掉第二个,然后再卸载第一个,如果你更好的想玩游戏,把OPENGL也升级一下,freetype不用升级了,rh7.3自带的就可以满足汉字的支持了
把你的C盘挂接在linux下
建立目录来挂接
c盘
mkdir /winc
挂接C盘
mount /dev/hda1 /winc
下载wine的最新版到/wind
http://www.winehq.com上边有它的最新版
wine-20020804.tar.gz
以普通用户登录linux,把wine-20020804.tar.gz拷贝到/tmp目录下
进入/tmp目录
shell>cd /tmp
解压wine
shell>tar vfzx wine-20020804.tar.gz
进入解压后的目录
shell>cd wine-20020804
用wine的安装工具进行安装
shell>./tools/wineinstall
然后就是漫长的等待,
在安装过程中它要你回答yes/no,你选择yes就可以了
wine自动搜索windows的目录的,等你你编译完了,它要让你输入root的密码进入安装
这是就快安装完了,如果安装成功,就会有good lucky的提示
在shell下运行wine,第一次运行不成攻,这是正常,因为没有在/root/.wine/config文件里配置好.找到这些把
[Drive C]
"Path" = "/usr/share/win_c"
"Type" = "hd"
"Label" = "MS-DOS"
"Filesystem" = "win95"
改为:[Drive C]
"Path" = "/winc"
"Type" = "hd"
"Label" = "MS-DOS"
"Filesystem" = "win95"
就可以了,如果你安装了simsun字体.wine默认就会找到这个字体的
下边就是我的/root/.wine/config
WINE REGISTRY Version 2
;; All keys relative to \\Machine\\Software\\Wine\\Wine\\Config ;;
;; MS-DOS drives configuration
;;
;; Each section has the following format:
;; [Drive X]
;; "Path"="xxx" (Unix path for drive root)
;; "Type"="xxx" (supported types are ‘floppy‘, ‘hd‘, ‘cdrom‘ and ‘network‘)
;; "Label"="xxx" (drive label, at most 11 characters)
;; "Serial"="xxx" (serial number, 8 characters hexadecimal number)
;; "Filesystem"="xxx" (supported types are ‘msdos‘/‘dos‘/‘fat‘, ‘win95‘/‘vfat‘, ‘unix‘)
;; This is the FS Wine is supposed to emulate on a certain
;; directory structure.
;; Recommended:
;; - "win95" for ext2fs, VFAT and FAT32
;; - "msdos" for FAT16 (ugly, upgrading to VFAT driver strongly recommended)
;; DON‘T use "unix" unless you intend to port programs using Winelib !
;; "Device"="/dev/xx" (only if you want to allow raw device access)
;;
[Drive A]
"Path" = "/mnt/floppy"
"Type" = "floppy"
"Label" = "Floppy"
"Serial" = "87654321"
"Device" = "/dev/fd0" [Drive C]
"Path" = "/winc"
"Type" = "hd"
"Label" = "MS-DOS"
"Filesystem" = "win95" [Drive D]
"Path" = "/mnt/cdrom"
"Type" = "cdrom"
"Label" = "CD-Rom"
"Filesystem" = "win95"
; make sure that device is correct and has proper permissions !
"Device" = "/dev/cdrom" [Drive E]
"Path" = "/tmp"
"Type" = "hd"
"Label" = "Tmp Drive"
"Filesystem" = "win95" [Drive F]
"Path" = "${HOME}"
"Type" = "network"
"Label" = "Home"
"Filesystem" = "win95" [Drive Z]
"Path" = "/"
"Type" = "network"
"Label" = "Root"
"Filesystem" = "win95" [wine]
"Windows" = "c:\\windows"
"System" = "c:\\windows\\system"
"Temp" = "e:\\"
"Path" = "c:\\windows;c:\\windows\\system;e:\\;e:\\test;f:\\"
"Profile" = "c:\\windows\\Profiles\\Administrator"
"GraphicsDriver" = "x11drv"
; Wine doesn‘t pass directory symlinks to Windows programs by default.
; Enabling this may crash some programs that do recursive lookups of a whole
; subdir tree in case of a symlink pointing back to itself.
;"ShowDirSymlinks" = "1"
"ShellLinker" = "wineshelllink" # <wineconf> [DllDefaults]
; "EXTRA_LD_LIBRARY_PATH" = "${HOME}/wine/cvs/lib"
"DefaultLoadOrder" = "native, builtin, so" [DllOverrides]
"commdlg" = "builtin, native"
"comdlg32" = "builtin, native"
"ver" = "builtin, native"
"version" = "builtin, native"
"shell" = "builtin, native"
"shell32" = "builtin, native"
"lzexpand" = "builtin, native"
"lz32" = "builtin, native"
"comctl32" = "builtin, native"
"commctrl" = "builtin, native"
"wsock32" = "builtin"
"winsock" = "builtin"
"advapi32" = "builtin, native"
"crtdll" = "builtin, native"
"mpr" = "builtin, native"
"winspool.drv" = "builtin, native"
"ddraw" = "builtin, native"
"dinput" = "builtin, native"
"dsound" = "builtin, native"
"mmsystem" = "builtin"
"winmm" = "builtin"
"msvcrt" = "native, builtin"
"msvideo" = "builtin, native"
"msvfw32" = "builtin, native"
"mcicda.drv" = "builtin, native"
"mciseq.drv" = "builtin, native"
"mciwave.drv" = "builtin, native"
"mciavi.drv" = "native, builtin"
"mcianim.drv" = "native, builtin"
"msacm.drv" = "builtin, native"
"msacm" = "builtin, native"
"msacm32" = "builtin, native"
"midimap.drv" = "builtin, native"
"wnaspi32" = "builtin"
"icmp" = "builtin" [x11drv]
; Number of colors to allocate from the system palette
"AllocSystemColors" = "100"
; Use a private color map
"PrivateColorMap" = "N"
; Favor correctness over speed in some graphics operations
"PerfectGraphics" = "N"
; Color depth to use on multi-depth screens
;;"ScreenDepth" = "16"
; Name of X11 display to use
;;"Display" = ":0.0"
; Allow the window manager to manage created windows
"Managed" = "N"
; Use a desktop window of 640x480 for Wine
;"Desktop" = "640x480"
; Use XFree86 DGA extension if present
"UseDGA" = "Y"
; Use XShm extension if present
"UseXShm" = "Y"
; Enable DirectX mouse grab
"DXGrab" = "N"
; Create the desktop window with a double-buffered visual
; (useful to play OpenGL games)
"DesktopDoubleBuffered" = "N"
; Code page used for captions in managed mode
; 0 means default ANSI code page (CP_ACP == 0)
"TextCP" = "0"
; Use this if you have more than one port for video on your setup
; (Wine uses for now the first ‘input image‘ it finds).
;; "XVideoPort" = "43" [fonts]
;Read documentation/fonts before adding aliases
"Resolution" = "96"
"Default" = "-misc-simsun-" [serialports]
"Com1" = "/dev/ttyS0"
"Com2" = "/dev/ttyS1"
"Com3" = "/dev/ttyS2"
"Com4" = "/dev/modem" [parallelports]
"Lpt1" = "/dev/lp0" [spooler]
"LPT1:" = "|lpr"
;"LPT2:" = "|gs -sDEVICE=bj200 -sOutputFile=/tmp/fred -q -"
;"LPT3:" = "/dev/lp3" [ports]
;"read" = "0x779,0x379,0x280-0x2a0"
; "write" = "0x779,0x379,0x280-0x2a0" [spy]
"Exclude" = "WM_SIZE;WM_TIMER;" [registry]
;These are all booleans. Y/y/T/t/1 are true, N/n/F/f/0 are false.
;Defaults are read all, write to Home
; Global registries (stored in /etc)
"LoadGlobalRegistryFiles" = "Y"
; Home registries (stored in ~user/.wine/)
"LoadHomeRegistryFiles" = "Y"
; Load Windows registries from the Windows directory
"LoadWindowsRegistryFiles" = "Y"
; TRY to write all changes to home registries
"WritetoHomeRegistryFiles" = "Y"
; Registry periodic save timeout in seconds
; "PeriodicSave" = "600"
; Save only modified keys
"SaveOnlyUpdatedKeys" = "Y" [Tweak.Layout]
;; supported styles are ‘Win31‘(default), ‘Win95‘, ‘Win98‘
"WineLook" = "Win98" [Console]
;"Drivers" = "tty"
;"XtermProg" = "nxterm"
;"InitialRows" = "25"
;"InitialColumns" = "80"
;"TerminalType" = "nxterm" [Clipboard]
"ClearAllSelections" = "0"
"PersistentSelection" = "1" # </wineconf>
我下载的是较新的版本,后缀为bin的文件,文件名为:
j2sdk-1_4_0-linux-i386-rpm.bin
安装过程:
将该文件拷贝到/tmp目录下
----//注:cp j2sdk-1_4_0-linux-i386-rpm.bin /tmp
然后执行该文件
----//注: ./j2sdk-1_4_0-linux-i386-rpm.bin
----//注 注意/前面有个点"."
会出现一些信息显示,先按空格跳过信息显示到询问你同
意否?按Y,然后回车确定就可以了,这样会生成一个rpm文
件在当前目录下
运行rpm文件
----//注:rpm -Uivh j2sdk-1_4_0-fcs-linux-i386.rpm [设置JAVA环境变量]
用Advanced Editor编辑profile文件
----//注:该文件在/etc目录下
在最后面加入如下内容:
export PATH=/usr/java/j2sdk1.4.0/bin:$PATH export CLASSPATH=.:/usr/java/j2sdk1.4.0/lib/tools.jar:/usr/java/j2sdk1.4.0/lib:$CLASSPATH 存盘退出(不同版本的路径会有所不同,请根据自己实际
情况更改)
然后要让他生效,在命令行中敲打如下命令
----//注:source /etc/profile
如果希望其他用户可以使用java,用其他用户帐号登录,
然后在命令行下敲打如上的命令
----//注:source /etc/profile 这些工作做完后用如下命令测试一下
----//注:which java(显示出来相关信息就可以了) [浏览器支持JAVA问题]
前提是你已经安装了javaVM,并且配置好了环境变量 在Konqueror Webbrowsing中:
JAVA设置:在control center(控制中心) > web browsing(页面浏览),
点击konqueror browser(konqueror浏览器),在JAVA选项卡
中"全局启用JAVA"打上勾,然后应用退出. 在Mozilla Webbrowsing中:
进入mozilla的plugin目录下,将JRE的的一个插件文
件链接到mozilla的plugin目录下
(官方站点上的文章说绝对不能拷贝这个文件到该目录 下,只能链接,以前我就是在这点上犯了错误,所以怎么
做都是退出浏览器,切记!!)
----//注:在命令行下(root权限),
----//注:cd /usr/share/mozilla/plugins
----//注:ln -s /usr/java/j2sdk1.4.0/jre/plugins/i386/ns610/libjavaplugin_oji14.so libjavaplugin_oji14.so 现在从新打开新的窗口,在http://ip:5800,看看,OK,出来拉看到拉久违的那个CTL +ALT+DEL按键,好拉下面的就是隐藏图表,进程的问题,图表可以修改注册表,进程
可以用一些注入进程等技术,具体自己去搜索一下,很多的。