Skip to content
Snippets Groups Projects
Commit cf1fbec8 authored by RIEHM Clement's avatar RIEHM Clement
Browse files

Ajout partie ssh

parent 8e6723a4
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -113,7 +113,7 @@ Ajouter \verb|$(vagrant_prompt_info)| au PROMPT dans le themes
\subsection*{\#10}
\section{SSH}
\subsection*{#1}
\subsection*{\#1}
\begin{lstlisting}
ssh alice@192.168.56.2
......@@ -121,6 +121,53 @@ ssh alice@192.168.56.2
L'history des utilisateurs sont vides.
\subsection*{\#2}
\begin{lstlisting}[language=bash]
bob@srv:~$ ssh-copy-id alice@192.168.56.3
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/bob/.ssh/id_rsa.pub"
alice@192.168.56.3's password:
Number of key(s) added: 1
\end{lstlisting}
Après la copie de la clef bob peut se conecter sans le mot de passe de alice.
\begin{lstlisting}[language=bash]
ssh-agent
ssh-add
Ces commandes permettent de ne pas taper le mot de passe a chaque connections.
\end{lstlisting}
\subsection*{\#3}
\begin{lstlisting}[language=bash]
alice@cli:~$ ssh-keyscan 192.168.56.3 > .ssh/known_hosts
# 192.168.56.3:22 SSH-2.0-OpenSSH_7.4p1 Debian-10+deb9u7
# 192.168.56.3:22 SSH-2.0-OpenSSH_7.4p1 Debian-10+deb9u7
# 192.168.56.3:22 SSH-2.0-OpenSSH_7.4p1 Debian-10+deb9u7
alice@cli:~$ ssh bob@192.168.56.3
bob@192.168.56.3's password:
\end{lstlisting}
\subsection*{\#4}
\begin{lstlisting}[language=bash]
ArchNilux% sftp alice@192.168.56.2
alice@192.168.56.2's password:
Connected to 192.168.56.2.
sftp> put Vagrantfile
Uploading Vagrantfile to /home/alice/Vagrantfile
Vagrantfile 100% 1419 875.2KB/s 00:00
sftp> get /etc/passwd
Fetching /etc/passwd to passwd
passwd 100% 1640 534.1KB/s 00:00
sftp> ^D
sshfs alice@192.168.56.2:/home tmp
\end{lstlisting}
Le fichier a bien été modifié sur le home d'alice
\subsection*{\#5}
\section{Git}
\subsection*{\#1}
\begin{lstlisting}[language=bash]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment