Contents |
Note: this method is insecure! only do this together with a trusted user.
1. change password
$ passwd
2. let friendly user log in with the temporary password - use screen to work together
$ screen (you) $ screen -x (friend)
3. change password back
$ passwd
4. ensure that everyone but you is logged off your account
$ watch -d -n 1 who username pts/2 Sep 19 21:52 (your IP / DNS name) someone pts/4 Sep 19 19:09 (some.server.dk) username pts/5 Sep 19 20:40 (friends IP / DNS name) (wait for him to disappear)
5. check that your password is ok
$ passwd
Note: this method is safe, because the only thing transmitted is the terminal OUTPUT
Note: this method doesn't work if you're logged into a screen, however, you can start the screen once the 'script' command has been started
$ mkfifo fifoname
here you could set permissions on the fifo to prevent unauthorized access to it
$ script -f fifoname
'script' now runs a new bash and copies the output to the fifo.
the other user runs the command
$ cat fifoname
and voila, the other user sees everything output to the screen
Via Browser:
$ mkfifo fifoname $ cat fifoname|nc -l -p1234 $ script -q -f fifoname -c 'echo "<pre>";PS1="$ " sh'
Here, you can execute commands, and the user can see them in real time if he browses to your.ip.address:1234. When you're done, exit the shell.
$ fg <Ctrl-C>
Via NetCat:
$ mkfifo fifoname $ cat fifoname|nc -l -p1234 $ script -q -f fifoname -c 'PS1="$ " sh'
The other user then executes:
$ nc your.ip.address 1234
Then, you can execute commands, and the user can see them in real time. When you're done, exit the shell.
$ fg <Ctrl-C>
For security, you could use cryptcat instead of netcat.
of course, you can also log the output to an ordinary file
$ script -a logfile</pre>