authorised_keys file if usually in the users home directory, but in large or audited environments it could also be on an external system (ldap, postgresql,...) so the user cannot change it by himself. This is usually so that when the key gets lost the server admin has to be notified and it's changed/revoked on all systems at the same time.
@NorbertdeRooy9 сағат бұрын
So, a few things (Yes I used -G many times before) But there is something you are misunderstanding. First of all `ssh -G` does not _connect _to the server, it prints what configuration it WOULD use if you would connect (try it, disconnect your machine from the network and type the command). Now since it is most likely default config your next command (ssh-keygen) will overwrite the ssh private key (highly likely causing you to lose connection with all your other servers)! e.g. if you setup your servers to block logging in with password (which you really should), you only have private key login, but you just overwrote that. Also please stop telling people to not password protect their private keys (ssh-keygen -N) ssh-copy-id is good to use, but as mentioned before is likely to not work anymore because you overwrote the old file and password login should be disabled.
@idjoooo11 сағат бұрын
anjir bang suka banget gw ama konten lu, ga ada link donate kah?
@aidengaming7401Күн бұрын
can you share the meme you showed at start? Geto brain opening meme
@HomeroeКүн бұрын
Well, this was simple but pretty good. The youtube algorithm does it again
@lel7531Күн бұрын
Damn your content goes hard, do you have a discord account by chance ?
@RunElevateКүн бұрын
kinda like doom rooms
@ggsapКүн бұрын
Why use only nix when you can use bedrock's hijack to convert it into nix+any distro you like as many times
@karansmittal2 күн бұрын
gold
@user-mn6wv4iw6r2 күн бұрын
If u already have ssh-config, what scenario you need to parse every parameter instead of using ssh-config to connect ssh
@ayehavgunne3 күн бұрын
I actually have used that. Very recently in fact. Still didn't help me though.
@HhddGufif3 күн бұрын
Cool. But sounds like its going to cause OS dependant branching in code
@stewie4103 күн бұрын
I'm not sure what we're trying to accomplish here, but there's a lot of improvements to the script that could be made; for consistency, readability & UX: - Basic -h or --help support isn't hard to implement, and can remind a user (yourself) how you're supposed to use the tool. - Probably worth checking if $1 is passed at all, before you try to use it. - Instead of `sed`'ing the path, you can use realpath -- assuming its available (and --canonicalize-missing if preferred) - An associative array can be used to store the output of `ssh -G`; then you don't need to manually strip out the parts you need, just use them directly. - If you'd still prefer to manually pull items out, at least use an indexed array & readarray/mapfile. Dunno how well YT's comment system will handle the formatting, but here's an example rewrite, without changing much: ``` #!/usr/bin/env bash show_help() { cat << EOF Apply ssh pubkey auth to specified ~/.ssh/config host USAGE: ${0##*/} [OPTIONS] NAME OPTIONS: -h, --help Show this help message EOF } real_path() { realpath --canonicalize-missing "${1}" } parse_config() { local key value while read -r key value; do config["${key}"]="${value}" done < <(ssh -G "${1}") } main() { if [[ "${1}" =~ -(h|-help) ]]; then show_help return 0 elif [[ -z "${1}" ]]; then printf 'No host specified ' >&2 return 1 fi local -A config parse_config "${1}" config['identityfile']="$(real_path "${config['identityfile']}")" ssh-keygen \ -t 'ed25519' \ -f "${config['identityfile']}" \ -qN "" ssh-copy-id \ -i "${config['identityfile']}.pub" \ "${config['user']}@${config['hostname']}" } main "${@}" ```
@qm3ster4 күн бұрын
What I need is QUIC 🥵
@harmanrzgarmuhammad67304 күн бұрын
This goes hard ngl
@LifeGeneralist4 күн бұрын
ssh-copy-id?
@binaryparrot33524 күн бұрын
For a video with less than 1k views, I did not expect such quality content :)
@HuynhNguyenGiaBaoKCT4 күн бұрын
great video! May I know the theme ?
@MeghdipKarmakar4 күн бұрын
bruh
@m.awadsyahid23924 күн бұрын
🤣🤣🤣 I can't stop laughing
@disnuprasad78364 күн бұрын
Subbed.
@DLL_C_DLL4 күн бұрын
I popped in here thinking it was a linux slander meme, but this is actually really good teaching content! Nice work!
@thespencerowen5 күн бұрын
Best explanation ever
@khanra175 күн бұрын
Poorest explanation ever. Please stop and get some help. 🤮🤮🤮🤮
@ggsap5 күн бұрын
0:29 he* not him
@azizemirkorkmaz27605 күн бұрын
More video like thiis. But don't neglect long videos. :)
@mc4ndr35 күн бұрын
rsync, and the user likely knows the path to the file before connecting with -G.
@Link-channel5 күн бұрын
The video is great! (I don't understand why mention JavaScript to do something completely unrelated to browser frontend, i thought the terminal was the place for bash scripting, or C, or Go, but maybe that's the new normal thanks to nodejs i guess)
@Link-channel5 күн бұрын
You didn't mention CTRL+Z
@threepe06 күн бұрын
Or just use ssh-copy-id. This is basically a long way of doing just that
@agenttank3 күн бұрын
he IS usimg ssh-copy-id... i am unsure what the guy in the videos is accomplishing
@threepe02 күн бұрын
@@agenttank oh yeah. Yeah, strange then. This seems like a Rube Goldberg machine but less useful or practical
@albert69Einstein6 күн бұрын
is their a way to force the system to assign PIDs from a set or range of values ?
@albert69Einstein6 күн бұрын
if not there should be. this way you could automate your tasks knowing what the PIDs will be.
@wisteela6 күн бұрын
I don't know this existed.
@siuyutpang23356 күн бұрын
really appreciate it, I have never notice the capital g option in ssh, it's really useful for automatically generate key from ssh config file
@MarkHopewell7 күн бұрын
We have a very well known author here in the UK called Michael Rosen. You are his twin!
@alphamineron7 күн бұрын
The little diagram updating as you explained was one of the most straightforward and brilliant teaching techniques I’ve seen! The production quality of this channel is incredible! Thank you so much for your work
@engine_man7 күн бұрын
Would like to hear of a good use case for this
@UKsystems7 күн бұрын
You might not think of one, but there will always be an instance where this will come in handy
@engine_man7 күн бұрын
@@UKsystems yea I’m asking for one. lol
@marcarlotuico54496 күн бұрын
IoT?
@UKsystems5 күн бұрын
@@marcarlotuico5449 definitely for things that don’t require a lot of security this would be very easy to implement
@youtube-is-cringe5 күн бұрын
Literally anything to do with devices Like idk, a machine/sensor in a factory that sends its state or whatever man
@Dom-De7 күн бұрын
Extra credit: read all hosts from known_hosts, check key access isn't *already* in place, and only generate / distribute as required....
@PS3PCDJ7 күн бұрын
I would personally add a check to see if the specified identity file exists on the system, and only generate it, if it doesn't [ -a "$identityfile" ] || ssh-keygen -t ed25519 -f "$identityfile" -q -N "" instead of just ssh-keygen -t ed25519 -f "$identityfile" -q -N ""
@Youkouleleh8 күн бұрын
It's kinda annoying because the output of the background jobs are showing on the console
@Echiduna8 күн бұрын
good video!
@azertyuiop4328 күн бұрын
Great font, what it's called ?
@somebodyelse91308 күн бұрын
It looks like JetBrains Mono.
@nixhero8 күн бұрын
Yes it's JetBrains Mono
@azertyuiop4327 күн бұрын
@@nixheroThanks
@theepicguy65758 күн бұрын
Lmaoo
@arjix87388 күн бұрын
I actually use it often!
@ismbks8 күн бұрын
all my Gs know this
@korigamik9 күн бұрын
Nice! What do you use for the tts and for editing the video man?
@nixhero9 күн бұрын
Elevenlabs tts, Krita, and CapCut
@chanpeter2059 күн бұрын
good job, now I don't need to experience the process of "Never spend 6 minutes doing something by hand when you can spend 6 hours failing to automate it"
@minefacex9 күн бұрын
Nix class video pull
@magnusmalmborn86659 күн бұрын
So, can you claim compensation fron the car insurance after a drive -by shooting?
@aureli4nus10 күн бұрын
mythical video pull
@90hijacked10 күн бұрын
This is actually extremely useful, i literally have hundreds of servers in my config, proxycommand + openvpn3/openconnect ftw