Δημοσιεύτηκε: 28 Νοέμ 2011, 00:13
από medigeek
http://ubuntuforums.org/showthread.php?t=39528
έγραψε:None of the current front-ends to rdesktop support drive redirection so you will need to run it from a command line. An example is shown below:
Κώδικας: Επιλογή όλων
rdesktop -g1024x768 -a15 -r 'disk:linux=/home/' -p- 10.10.10.10


I haven't figured out how to map more than one drive, so I usually just map my home drive since that contains all my data anyway.

Some common command switches are:
-g for size of the window, this is in the format HorizontalxVertical, ie 1024x768 or 800x600.
-a for desktop color depth, by default rdesktop uses 256 colors, to use 15 bit color use 15 and for 16 bit color use 16.
-u to pass a username to fill in for you
-p to pass the password for the username above
-x to set the speed to the remote host: m for modem, b for broadband and l for lan.
-r is the switch to redirect something from the local PC, to see all the options for this just type rdesktop from a terminal.

So using my example above, I am connecting to the server 10.10.10.10, using a resolution of 1024x768 and a 15bit color depth and creating a share on the windows box that points back to /home on my Linux PC.


Κώδικας: Επιλογή όλων
$ rdesktop -h
rdesktop: A Remote Desktop Protocol client.
Version 1.7.0. Copyright (C) 1999-2011 Matthew Chapman et al.
See http://www.rdesktop.org/ for more information.

Usage: rdesktop [options] server[:port]
-u: user name
-d: domain
-s: shell
-c: working directory
-p: password (- to prompt)
-n: client hostname
-k: keyboard layout on server (en-us, de, sv, etc.)
-g: desktop geometry (WxH)
-f: full-screen mode
-b: force bitmap updates
-L: local codepage
-A: enable SeamlessRDP mode
-B: use BackingStore of X-server (if available)
-e: disable encryption (French TS)
-E: disable encryption from client to server
-m: do not send motion events
-C: use private colour map
-D: hide window manager decorations
-K: keep window manager key bindings
-S: caption button size (single application mode)
-T: window title
-N: enable numlock syncronization
-X: embed into another window with a given id.
-a: connection colour depth
-z: enable rdp compression
-x: RDP5 experience (m[odem 28.8], b[roadband], l[an] or hex nr.)
-P: use persistent bitmap caching
-r: enable specified device redirection (this flag can be repeated)
'-r comport:COM1=/dev/ttyS0': enable serial redirection of /dev/ttyS0 to COM1
or COM1=/dev/ttyS0,COM2=/dev/ttyS1
'-r disk:floppy=/mnt/floppy': enable redirection of /mnt/floppy to 'floppy' share
or 'floppy=/mnt/floppy,cdrom=/mnt/cdrom'
'-r clientname=<client name>': Set the client name displayed
for redirected disks
'-r lptport:LPT1=/dev/lp0': enable parallel redirection of /dev/lp0 to LPT1
or LPT1=/dev/lp0,LPT2=/dev/lp1
'-r printer:mydeskjet': enable printer redirection
or mydeskjet="HP LaserJet IIIP" to enter server driver as well
'-r sound:[local[:driver[:device]]|off|remote]': enable sound redirection
remote would leave sound on server
available drivers for 'local':
alsa: ALSA output driver, default device: default
'-r clipboard:[off|PRIMARYCLIPBOARD|CLIPBOARD]': enable clipboard
redirection.
'PRIMARYCLIPBOARD' looks at both PRIMARY and CLIPBOARD
when sending data to server.
'CLIPBOARD' looks at only CLIPBOARD.
-0: attach to console
-4: use RDP version 4
-5: use RDP version 5 (default)


===

Κι άλλες πληροφορίες εδώ: http://www.singularity.be/2008/03/using ... ndows.html
Αναφέρει πάλι το -r, με λίγο διαφορετική προσέγγιση. Δυστυχώς δεν έχω rdesktop server για να το δοκιμάσω, οπόταν είσαι μόνος σου. :)

έγραψε:Of course, if you're like me, you don't want to go through the trouble of copying your files to a Windows server, with the intent to execute them through rdesktop later on. The whole idea is to script everything using rdesktop.
Fortunately, rdesktop has a cool feature that allows you to make a local directory available on the remote server. You can do this with the "-r disk:" option, which looks like this:
Κώδικας: Επιλογή όλων
rdesktop -r disk:local="/home/deepstar/" isa.example.com

In this example, I make my homedirectory "/home/deepstar" available on isa.example.com for the duration of the RDP session. The directory will be called "local" on the remote side and you can find it as "\\tsclient\local"
Now I can access all my files on the Windows host, including the batch script I created locally.
Unfortunately, cmd.exe can not access \\tsclient\local for some reason (something to do with UNC path and a registry setting). So we have to make it available in another way.
Using the "net" command in Windows, you can map a network drive onto a local drive:
Κώδικας: Επιλογή όλων
net use x: \\tsclient\local

This will map \\tsclient\local to X:, which is available from cmd.exe.
Now, unlike in bash, cmd.exe uses the "&" or "&&" keyword to separate commands on the commandline. So, to map the networkdrive to X: and execute the batch script all in a single invocation of rdesktop, this would be the commandline:
Κώδικας: Επιλογή όλων
rdesktop -r disk:local="/home/deepstar/" isa.example.com -s "cmd.exe /K net use x: \\\\tsclient\local & x:\hello.bat"