tech:notes_rsh_rcp
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| tech:notes_rsh_rcp [2026/01/22 10:45] – Jean-Baptiste | tech:notes_rsh_rcp [2026/01/22 19:51] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Notes rsh rcp | ||
| + | |||
| + | Voir : | ||
| + | * http:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | Voir aussi : | ||
| + | * https:// | ||
| + | |||
| + | ** Ne pas utilser ce truc ** | ||
| + | |||
| + | Use of rsh is discouraged due to the inherent insecurity of host-based authentication. | ||
| + | |||
| + | Source : `man rsh` | ||
| + | |||
| + | |||
| + | Also note that the design of the .rhosts system is COMPLETELY INSECURE except on a carefully firewalled private network. Under all other circumstances, | ||
| + | |||
| + | Source : `man in.rshd` | ||
| + | |||
| + | |||
| + | |||
| + | rsh : Ce programme est issu du package rlogin | ||
| + | |||
| + | il faut que le compte utilisé soit reconnu par la machine distante. Pour être reconnu, l' | ||
| + | |||
| + | |||
| + | |||
| + | ## Protocole | ||
| + | |||
| + | Ports | ||
| + | ~~~ | ||
| + | rsh hostname (port 513) | ||
| + | rsh hosname commande (port 514) | ||
| + | ~~~ | ||
| + | |||
| + | ## Coté serveur | ||
| + | |||
| + | ## Avec le compte root | ||
| + | |||
| + | ~~~bash | ||
| + | apt-get install rsh-client rsh-server | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ~~~bash | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | echo " | ||
| + | ~~~ | ||
| + | |||
| + | Le fichier hosts.equiv / .rhosts autorise ou interdit à des ordinateurs et à des utilisateurs l' | ||
| + | |||
| + | `/ | ||
| + | |||
| + | `~/.rhosts` per-user trusted host-user pairs list | ||
| + | |||
| + | rsh, rlogin et ssh utilisent ces fichiers | ||
| + | |||
| + | |||
| + | ### Syntaxe de .rhosts hosts.equiv | ||
| + | |||
| + | ~~~ | ||
| + | # hostname [username] | ||
| + | |||
| + | somehost | ||
| + | somehost username | ||
| + | |||
| + | ~~~ | ||
| + | |||
| + | |||
| + | For root login to succeed here with pam_securetty, | ||
| + | ~~~bash | ||
| + | echo " | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Coté client | ||
| + | |||
| + | Avec le compte utilisateur | ||
| + | |||
| + | ~~~bash | ||
| + | apt-get install rsh-client | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | echo plop > plop.txt | ||
| + | rcp plop.txt root@localhost:/ | ||
| + | rcp plop.txt localhost:/ | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ~~~bash | ||
| + | rsh -l user localhost | ||
| + | rlogin -l user localhost | ||
| + | # NOTE : rsh without a command switches to rlogin. | ||
| + | |||
| + | rsh -l user localhost command | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | ### Shell meta-characters escape | ||
| + | |||
| + | Shell meta-characters which are not quoted are interpreted on local machine, while quoted meta-characters are interpreted on the remote machine | ||
| + | |||
| + | Appends the remote file remotefile to the local file localfile | ||
| + | ~~~bash | ||
| + | rsh otherhost cat remotefile >> localfile | ||
| + | ~~~ | ||
| + | |||
| + | Appends remotefile to other_remotefile | ||
| + | ~~~bash | ||
| + | rsh otherhost cat remotefile ">>" | ||
| + | ~~~ | ||
| + | |||
| + | ## Cas 1 | ||
| + | |||
| + | |||
| + | Sur le client - NOK | ||
| + | ~~~ | ||
| + | test@rsh-cli: | ||
| + | Permission denied. | ||
| + | ~~~ | ||
| + | |||
| + | Sur le serveur | ||
| + | ~~~bash | ||
| + | echo " | ||
| + | ~~~ | ||
| + | |||
| + | Sur le client - OK | ||
| + | ~~~ | ||
| + | test@rsh-cli: | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | ## Autres | ||
| + | |||
| + | |||
| + | Dans un conteners | ||
| + | ~~~ | ||
| + | # ps -ef | ||
| + | UID PID PPID C STIME TTY TIME CMD | ||
| + | root | ||
| + | root | ||
| + | root | ||
| + | root 1071 | ||
| + | ~~~ | ||
| + | |||
| + | ~~~ | ||
| + | # rsh localhost | ||
| + | rlogind[1078]: | ||
| + | # | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ----- | ||
| + | |||
| + | ~~~ | ||
| + | root | ||
| + | root | ||
| + | root | ||
| + | user1 3072724 3072597 | ||
| + | ~~~ | ||
| + | |||
| + | Bizarre, je ne vois pas le process ' | ||
| + | Le dernier processus ' | ||
| + | |||
| + | ~~~ | ||
| + | # ss -tlnp |grep xinetd | ||
| + | 0 64 | ||
| + | 0 64 | ||
| + | ~~~ | ||
| + | |||
| + | `/ | ||
| + | |||
| + | ~~~ | ||
| + | # default: on | ||
| + | # description: | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | service shell | ||
| + | { | ||
| + | disable = no | ||
| + | socket_type | ||
| + | wait = no | ||
| + | user = root | ||
| + | log_on_success | ||
| + | log_on_failure | ||
| + | server | ||
| + | } | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | FIXME | ||
| + | |||
