Skip to playerSkip to main contentSkip to footer
  • 2 days ago
Transcript
00:00hello dudes i wanted to set up an ssh server on my newly created virtual machine of nexo s
00:10i made this before and i wanted to make a better video
00:14when it comes to the quality and everything okay so we should open the terminal
00:22let's zoom in a little bit
00:24yes i hope you can see it clearly we go to slash etc slash nexo s slash configuration dot nix our
00:36default configuration file for our nexo s system password here since we're using
00:44this with the root privileges and then we scroll down to
00:54a block of code
01:04known as programs dot gnu pg dot agent this whole block of code we uncommented
01:24remember to uncomment from the first curly braces i mean starting from this line up to this line
01:39and then we look for a line starting with service dot open ssh we look for it maybe anywhere in this
01:50uh configuration file here it is services not service services dot open ssh dot enable and then
02:05networking dot
02:09this one this changed from my previous video so you need to be aware of it
02:15it i always enable my firewall otherwise if you don't you don't need to do the steps of the firewall
02:24and then this one i like to keep it true and and comment it to enable my firewall
02:34uh i guess that's it for now for the configuration file which we're gonna come back to anytime soon
02:45save
02:45control x y enter it's gonna save it and then we run the command ssh dash key gen
02:58enter here enter here enter again no passphrase all right the next step is taking the public key
03:13which is stored here this should uh be given to you as you you can see here after generating the key
03:24you should get yours i mean your system should generate it and tell you where it is stored the default one
03:35should be slash home slash your username in my case i call it my username username uh slash dot ssh slash
03:44and it should be like that enter we wanna see this public key so we can add it to our configuration file
03:56where we were before uh this one i don't know if it's yeah that's it so this sounds like it's a different
04:10type it's not like the one before it's shorter and uh i didn't wanna finish the path which is after
04:18slash dot ssh because it may be different from a machine to another and i don't know maybe like they
04:25decided to go with the new type of encryption and stuff we go back to our uh configuration file
04:33and slash etc slash nix os slash configuration dot nix uh password scroll down to look for a piece of code
04:44of the user itself you're gonna see it now
04:50yes inside this piece of code we should type uh open ssh all in lower case auto
05:10auto raised auto raised here k keys our key or key authorized key should be uppercase the key in our
05:27authorized key dot keys
05:30equals uh bracket uh double quotation mark and we paste our code or not code our public key here
05:46and then we close the quotation mark and the bracket and semi-column let's uh double check it to see if it
05:55is correct or not i guess it is so we have our authorized key as long as it is the correct syntax as i guess
06:08authorized key dot keys yeah keys shouldn't be uppercase only key in the authorized keyword which is all one
06:19one word should be uppercase i mean this one save ctrl x and then we get a confirmation you can save with ctrl s
06:28and then leave with ctrl x here i just uh i prefer doing them both at once y and enter clear out the screen
06:38and then we run sudo next os dash rebuild switch
06:53here we apply the changes and then they should take effect after rebooting the system it's gonna have
06:59an extra uh boot entry inside of our grab menu which should be the default one
07:08it's like that in order for the user to revert back the changes
07:25i guess we are having a little issue here
07:28i guess uh both should be in plural form keys and keys authorized keys and keys which are like two
07:42words one is uh associated with another here as i guess otherwise there may be another potential syntax for
07:51this thing so here i should add s and then save and exit and try again
08:07although this may not be the solution for this since the wiki tells something different
08:21all right that was the correct syntax both authorized keys and the other keys should be in plural form so
08:39please be aware of it don't make the same mistake
08:46okay now it's time to reboot the system
08:51for the changes to take effect
08:59uh since i'm using a virtual machine here my network needs to be
09:14in order for them to connect to all my uh devices that are outside of the virtual network that's made by
09:34the hypervisor host bridged adapter here and then okay
09:46you don't need to do that in case you aren't using a virtual machine
09:58or write password here
10:13let me make the
10:16appearance better
10:20never mind okay so now we should uh look for our ip address by typing ipa
10:26I guess we need to I need to disconnect and then connect the network again devices and here
10:43we should now check the IP address that's gonna be assigned by my router to this machine IPA and
10:55we can see that we have 10.1.1.8 let's now run SSH username if I can type it correctly 10.1.1.8
11:12yes password clear and then cat etc os release and we are connected through SSH to our NixOS machine
11:28I guess that's it for this video please don't forget to subscribe like share and comment and see you

Recommended