Различия между версиями 8 и 9
Версия 8 от 2020-03-17 08:48:25
Размер: 1639
Редактор: FrBrGeorge
Комментарий:
Версия 9 от 2020-03-17 08:49:45
Размер: 1652
Редактор: FrBrGeorge
Комментарий:
Удаления помечены так. Добавления помечены так.
Строка 2: Строка 2:
 1.#0 Run "`Git bash`" unix-like commandline  1.#0 (on windows) Run "`Git bash`" unix-like commandline

01. Using command line ssh over ssh

  1. (on windows) Run "Git bash" unix-like commandline

    • tune font size and appearance
    • use only fixed-width fonts
  2. Connect ssh user@server

  3. Attach demo screen
    • Teacher: start shared terminal session: tmux -S /tmp/demo.shared; chgrp students /tmp/demo.shared

    • Student: connect to shared terminal session: tmux -S /tmp/demo.shared attach -r

  4. Student: open second git bash again and do another ssh user@server

From now on teacher can show all he wants, and student can observe and re-produce on his second terminal connection

Code - compile - run

  • ls files
  • make an unique directory
  • cd there
  • ls (no files)
  • mcedit file.c
    • this program
         1   #include <stdio.h>
         2   int main(int argc, char *argv[]) {
         3       int i;
         4       for(i=0; i<argc; i++)
         5           printf("%d parameter: %s\n", i, argv[i]");
         6       return 0;
         7   }
      
      • F2 save, ESC ESC exit
    • complie: cc file.c

    • correct errors if any
    • run with ./a.out

    • compile cc file.c -o prog

    • run ./prog

Command arguments

Try run:

  • ./prog 1 2 3

  • ./prog weqr rtgh yt

  • ./prog wqe       sdfsd         sfds

  • ./prog "sa sa fsa f" 'sdfsdf sdfsfs s'

Use scp

  • disconnect from server (do not forget! :) )

  • create any file:
     $ echo sdaf sadfsad fsadf > unique.file.name
  • copy file to server with:
     $ scp unique.file.name user@server:
    • (mind ":" at the end)

  • ssh back to server
  • ls and see all the files`

H/W

Make sure you can connect to sugon server over ssh

HSE/ProgrammingOS/Lab_01_UsingSshCmdline (последним исправлял пользователь FrBrGeorge 2020-03-17 08:49:45)