[{"data":1,"prerenderedAt":485},["ShallowReactive",2],{"content-query-nBt2uCy1pL":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"tags":10,"body":11,"_type":479,"_id":480,"_source":481,"_file":482,"_stem":483,"_extension":484},"/tutorials/ssh","tutorials",false,"","Remote access via SSH","Accessing the server remotely via SSH.","ssh",{"type":12,"children":13,"toc":475},"root",[14,21,90,94,101,106,119,139,144,245,266,279,305,308,314,319,339,344,464,469],{"type":15,"tag":16,"props":17,"children":18},"element","p",{},[19],{"type":20,"value":9},"text",{"type":15,"tag":22,"props":23,"children":27},"pre",{"className":24,"code":25,"language":26,"meta":7,"style":7},"language-bash shiki shiki-themes github-light monokai monokai github-light monokai","ssh \u003Caccount_name>@\u003Cserver_hostname>\n","bash",[28],{"type":15,"tag":29,"props":30,"children":31},"code",{"__ignoreMap":7},[32],{"type":15,"tag":33,"props":34,"children":37},"span",{"class":35,"line":36},"line",1,[38,43,49,55,61,66,71,76,81,85],{"type":15,"tag":33,"props":39,"children":41},{"style":40},"--shiki-default:#6F42C1;--shiki-dark-mode:#A6E22E;--shiki-sky-dark-mode:#A6E22E;--shiki-light-mode:#6F42C1;--shiki-blue-mode:#A6E22E",[42],{"type":20,"value":10},{"type":15,"tag":33,"props":44,"children":46},{"style":45},"--shiki-default:#D73A49;--shiki-dark-mode:#F92672;--shiki-sky-dark-mode:#F92672;--shiki-light-mode:#D73A49;--shiki-blue-mode:#F92672",[47],{"type":20,"value":48}," \u003C",{"type":15,"tag":33,"props":50,"children":52},{"style":51},"--shiki-default:#032F62;--shiki-dark-mode:#E6DB74;--shiki-sky-dark-mode:#E6DB74;--shiki-light-mode:#032F62;--shiki-blue-mode:#E6DB74",[53],{"type":20,"value":54},"account_nam",{"type":15,"tag":33,"props":56,"children":58},{"style":57},"--shiki-default:#24292E;--shiki-dark-mode:#F8F8F2;--shiki-sky-dark-mode:#F8F8F2;--shiki-light-mode:#24292E;--shiki-blue-mode:#F8F8F2",[59],{"type":20,"value":60},"e",{"type":15,"tag":33,"props":62,"children":63},{"style":45},[64],{"type":20,"value":65},">",{"type":15,"tag":33,"props":67,"children":68},{"style":51},[69],{"type":20,"value":70},"@",{"type":15,"tag":33,"props":72,"children":73},{"style":45},[74],{"type":20,"value":75},"\u003C",{"type":15,"tag":33,"props":77,"children":78},{"style":51},[79],{"type":20,"value":80},"server_hostnam",{"type":15,"tag":33,"props":82,"children":83},{"style":57},[84],{"type":20,"value":60},{"type":15,"tag":33,"props":86,"children":87},{"style":45},[88],{"type":20,"value":89},">\n",{"type":15,"tag":91,"props":92,"children":93},"hr",{},[],{"type":15,"tag":95,"props":96,"children":98},"h3",{"id":97},"server-aliases",[99],{"type":20,"value":100},"Server aliases",{"type":15,"tag":16,"props":102,"children":103},{},[104],{"type":20,"value":105},"Creating aliases for hosts in your local SSH config file.\nThis can be done to more easily connect to servers that have names that are too long and are hard to remember.",{"type":15,"tag":16,"props":107,"children":108},{},[109,111,117],{"type":20,"value":110},"You will need to run a Bash shell ",{"type":15,"tag":112,"props":113,"children":114},"strong",{},[115],{"type":20,"value":116},"on your local computer",{"type":20,"value":118},", such as Gnome Terminal, KDE Konsole, or Windows PowerShell.\nEdit your ssh config file with any text editor. To do it from the command line:",{"type":15,"tag":22,"props":120,"children":122},{"className":24,"code":121,"language":26,"meta":7,"style":7},"nano ~/.ssh/config\n",[123],{"type":15,"tag":29,"props":124,"children":125},{"__ignoreMap":7},[126],{"type":15,"tag":33,"props":127,"children":128},{"class":35,"line":36},[129,134],{"type":15,"tag":33,"props":130,"children":131},{"style":40},[132],{"type":20,"value":133},"nano",{"type":15,"tag":33,"props":135,"children":136},{"style":51},[137],{"type":20,"value":138}," ~/.ssh/config\n",{"type":15,"tag":16,"props":140,"children":141},{},[142],{"type":20,"value":143},"Then, enter the following information:",{"type":15,"tag":22,"props":145,"children":147},{"className":24,"code":146,"language":26,"meta":7,"style":7},"host \u003Calias>  # \u003Calias> is the name you would like to call the server (e.g. ocelot)\nhostname \u003Caddress>  # the server address, for instance abc.myserver.net or 10.0.0.2\nuser \u003Cusername>  # Your username on the server\n",[148],{"type":15,"tag":29,"props":149,"children":150},{"__ignoreMap":7},[151,183,214],{"type":15,"tag":33,"props":152,"children":153},{"class":35,"line":36},[154,159,163,168,173,177],{"type":15,"tag":33,"props":155,"children":156},{"style":40},[157],{"type":20,"value":158},"host",{"type":15,"tag":33,"props":160,"children":161},{"style":45},[162],{"type":20,"value":48},{"type":15,"tag":33,"props":164,"children":165},{"style":51},[166],{"type":20,"value":167},"alia",{"type":15,"tag":33,"props":169,"children":170},{"style":57},[171],{"type":20,"value":172},"s",{"type":15,"tag":33,"props":174,"children":175},{"style":45},[176],{"type":20,"value":65},{"type":15,"tag":33,"props":178,"children":180},{"style":179},"--shiki-default:#6A737D;--shiki-dark-mode:#88846F;--shiki-sky-dark-mode:#88846F;--shiki-light-mode:#6A737D;--shiki-blue-mode:#88846F",[181],{"type":20,"value":182},"  # \u003Calias> is the name you would like to call the server (e.g. ocelot)\n",{"type":15,"tag":33,"props":184,"children":186},{"class":35,"line":185},2,[187,192,196,201,205,209],{"type":15,"tag":33,"props":188,"children":189},{"style":40},[190],{"type":20,"value":191},"hostname",{"type":15,"tag":33,"props":193,"children":194},{"style":45},[195],{"type":20,"value":48},{"type":15,"tag":33,"props":197,"children":198},{"style":51},[199],{"type":20,"value":200},"addres",{"type":15,"tag":33,"props":202,"children":203},{"style":57},[204],{"type":20,"value":172},{"type":15,"tag":33,"props":206,"children":207},{"style":45},[208],{"type":20,"value":65},{"type":15,"tag":33,"props":210,"children":211},{"style":179},[212],{"type":20,"value":213},"  # the server address, for instance abc.myserver.net or 10.0.0.2\n",{"type":15,"tag":33,"props":215,"children":217},{"class":35,"line":216},3,[218,223,227,232,236,240],{"type":15,"tag":33,"props":219,"children":220},{"style":40},[221],{"type":20,"value":222},"user",{"type":15,"tag":33,"props":224,"children":225},{"style":45},[226],{"type":20,"value":48},{"type":15,"tag":33,"props":228,"children":229},{"style":51},[230],{"type":20,"value":231},"usernam",{"type":15,"tag":33,"props":233,"children":234},{"style":57},[235],{"type":20,"value":60},{"type":15,"tag":33,"props":237,"children":238},{"style":45},[239],{"type":20,"value":65},{"type":15,"tag":33,"props":241,"children":242},{"style":179},[243],{"type":20,"value":244},"  # Your username on the server\n",{"type":15,"tag":16,"props":246,"children":247},{},[248,250,256,258,264],{"type":20,"value":249},"Press ",{"type":15,"tag":29,"props":251,"children":253},{"className":252},[],[254],{"type":20,"value":255},"ctrl+X",{"type":20,"value":257}," and type ",{"type":15,"tag":29,"props":259,"children":261},{"className":260},[],[262],{"type":20,"value":263},"Y",{"type":20,"value":265}," to save.",{"type":15,"tag":16,"props":267,"children":268},{},[269,271,277],{"type":20,"value":270},"Now you can run ",{"type":15,"tag":29,"props":272,"children":274},{"className":273},[],[275],{"type":20,"value":276},"ssh \u003Calias>",{"type":20,"value":278},".",{"type":15,"tag":16,"props":280,"children":281},{},[282,288,290,296,298,304],{"type":15,"tag":283,"props":284,"children":285},"em",{},[286],{"type":20,"value":287},"Note",{"type":20,"value":289},": If the folder ",{"type":15,"tag":29,"props":291,"children":293},{"className":292},[],[294],{"type":20,"value":295},".ssh",{"type":20,"value":297}," does not exist in your home directory, you can create it with ",{"type":15,"tag":29,"props":299,"children":301},{"className":300},[],[302],{"type":20,"value":303},"mkdir /home/\u003Cusername>/.ssh",{"type":20,"value":278},{"type":15,"tag":91,"props":306,"children":307},{},[],{"type":15,"tag":95,"props":309,"children":311},{"id":310},"passwordless-login",[312],{"type":20,"value":313},"Passwordless login",{"type":15,"tag":16,"props":315,"children":316},{},[317],{"type":20,"value":318},"Using a public key to log in through SSH.\nThis allows you to log in to an SSH server without having to type your password every time.",{"type":15,"tag":16,"props":320,"children":321},{},[322,324,329,331,337],{"type":20,"value":323},"First, ",{"type":15,"tag":112,"props":325,"children":326},{},[327],{"type":20,"value":328},"on your local machine",{"type":20,"value":330},", run: ",{"type":15,"tag":29,"props":332,"children":334},{"className":333},[],[335],{"type":20,"value":336},"ssh-keygen",{"type":20,"value":338},", follow the prompts. You can leave the pass-phrase blank.\nThis will generate a pair of public and private keys for your user.",{"type":15,"tag":16,"props":340,"children":341},{},[342],{"type":20,"value":343},"Next, we will paste the generate key onto the server's list of authorized keys:",{"type":15,"tag":345,"props":346,"children":347},"ol",{},[348,367,403,414,426,447],{"type":15,"tag":349,"props":350,"children":351},"li",{},[352,354,359,361],{"type":20,"value":353},"List the ",{"type":15,"tag":112,"props":355,"children":356},{},[357],{"type":20,"value":358},"public",{"type":20,"value":360}," key with ",{"type":15,"tag":29,"props":362,"children":364},{"className":363},[],[365],{"type":20,"value":366},"cat ~/.ssh/id_rsa.pub",{"type":15,"tag":349,"props":368,"children":369},{},[370,372,378,380,386,388,394,396,401],{"type":20,"value":371},"Copy the entire key using ",{"type":15,"tag":29,"props":373,"children":375},{"className":374},[],[376],{"type":20,"value":377},"command+C",{"type":20,"value":379}," on Mac or ",{"type":15,"tag":29,"props":381,"children":383},{"className":382},[],[384],{"type":20,"value":385},"ctrl+shift+C",{"type":20,"value":387}," on Windows/Linux. It should look something like ",{"type":15,"tag":29,"props":389,"children":391},{"className":390},[],[392],{"type":20,"value":393},"ssh-rsa ABcdeFg12345... yourname@yourhost",{"type":20,"value":395},". (",{"type":15,"tag":283,"props":397,"children":398},{},[399],{"type":20,"value":400},"WARNING",{"type":20,"value":402},": Keep your private key private!!!)",{"type":15,"tag":349,"props":404,"children":405},{},[406,408,413],{"type":20,"value":407},"Log in to the server with ",{"type":15,"tag":29,"props":409,"children":411},{"className":410},[],[412],{"type":20,"value":10},{"type":20,"value":278},{"type":15,"tag":349,"props":415,"children":416},{},[417,419,425],{"type":20,"value":418},"On the server, open the authorized keys file with ",{"type":15,"tag":29,"props":420,"children":422},{"className":421},[],[423],{"type":20,"value":424},"nano ~/.ssh/authorized_keys",{"type":20,"value":278},{"type":15,"tag":349,"props":427,"children":428},{},[429,431,437,439,445],{"type":20,"value":430},"Paste your key at the bottom of this file (",{"type":15,"tag":29,"props":432,"children":434},{"className":433},[],[435],{"type":20,"value":436},"command+V",{"type":20,"value":438}," on Mac, ",{"type":15,"tag":29,"props":440,"children":442},{"className":441},[],[443],{"type":20,"value":444},"ctrl+shift+V",{"type":20,"value":446}," on Windows and Linux)",{"type":15,"tag":349,"props":448,"children":449},{},[450,452,457,458,463],{"type":20,"value":451},"Exit nano with ",{"type":15,"tag":29,"props":453,"children":455},{"className":454},[],[456],{"type":20,"value":255},{"type":20,"value":257},{"type":15,"tag":29,"props":459,"children":461},{"className":460},[],[462],{"type":20,"value":263},{"type":20,"value":265},{"type":15,"tag":16,"props":465,"children":466},{},[467],{"type":20,"value":468},"Now, the next time you try to log in with SSH, you will not need to type your password.\nCombine this with the alias for quickly accessing servers with SSH.",{"type":15,"tag":470,"props":471,"children":472},"style",{},[473],{"type":20,"value":474},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark-mode .shiki span {color: var(--shiki-dark-mode);background: var(--shiki-dark-mode-bg);font-style: var(--shiki-dark-mode-font-style);font-weight: var(--shiki-dark-mode-font-weight);text-decoration: var(--shiki-dark-mode-text-decoration);}html.dark-mode .shiki span {color: var(--shiki-dark-mode);background: var(--shiki-dark-mode-bg);font-style: var(--shiki-dark-mode-font-style);font-weight: var(--shiki-dark-mode-font-weight);text-decoration: var(--shiki-dark-mode-text-decoration);}html .sky-dark-mode .shiki span {color: var(--shiki-sky-dark-mode);background: var(--shiki-sky-dark-mode-bg);font-style: var(--shiki-sky-dark-mode-font-style);font-weight: var(--shiki-sky-dark-mode-font-weight);text-decoration: var(--shiki-sky-dark-mode-text-decoration);}html.sky-dark-mode .shiki span {color: var(--shiki-sky-dark-mode);background: var(--shiki-sky-dark-mode-bg);font-style: var(--shiki-sky-dark-mode-font-style);font-weight: var(--shiki-sky-dark-mode-font-weight);text-decoration: var(--shiki-sky-dark-mode-text-decoration);}html .light-mode .shiki span {color: var(--shiki-light-mode);background: var(--shiki-light-mode-bg);font-style: var(--shiki-light-mode-font-style);font-weight: var(--shiki-light-mode-font-weight);text-decoration: var(--shiki-light-mode-text-decoration);}html.light-mode .shiki span {color: var(--shiki-light-mode);background: var(--shiki-light-mode-bg);font-style: var(--shiki-light-mode-font-style);font-weight: var(--shiki-light-mode-font-weight);text-decoration: var(--shiki-light-mode-text-decoration);}html .blue-mode .shiki span {color: var(--shiki-blue-mode);background: var(--shiki-blue-mode-bg);font-style: var(--shiki-blue-mode-font-style);font-weight: var(--shiki-blue-mode-font-weight);text-decoration: var(--shiki-blue-mode-text-decoration);}html.blue-mode .shiki span {color: var(--shiki-blue-mode);background: var(--shiki-blue-mode-bg);font-style: var(--shiki-blue-mode-font-style);font-weight: var(--shiki-blue-mode-font-weight);text-decoration: var(--shiki-blue-mode-text-decoration);}",{"title":7,"searchDepth":185,"depth":185,"links":476},[477,478],{"id":97,"depth":216,"text":100},{"id":310,"depth":216,"text":313},"markdown","content:tutorials:ssh.md","content","tutorials/ssh.md","tutorials/ssh","md",1793934184841]