Warning: mysqli_query(): (HY000/1021): Disk full (/tmp/#sql_b0ff5_0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device") in /home/wirefan.com/public_html/wp-includes/class-wpdb.php on line 2349

Warning: mysqli_query(): (HY000/1021): Disk full (/tmp/#sql_b0ff5_0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device") in /home/wirefan.com/public_html/wp-includes/class-wpdb.php on line 2349
Technology

How to set an SSH username in MacOS


Two people using MacBook Pro

Apple

I’m mostly a Linux user. And I tend to have the same username on my desktops as I do on my servers. That means most of my SSH commands are in the form:

I’ve been using SSH for a very long time, and that habit is pretty much ingrained in me. 

However, when I’m on my MacBook or iMac, those usernames don’t tend to be the same as my Linux servers. This means that command then turns into something like this, where Username is the username on the remote server:

Okay, that’s not a huge difference, and adding a username to the command doesn’t take that much extra time. However, when you’re in and out of servers all day, that time adds up. On top of which, when you realize (for the tenth time that day) you’ve forgotten to add the username to the SSH command, it can be frustrating to have to [Ctrl]+[C] out of the command and retype.

Also: Don’t waste your money on these Apple products

Fortunately, there’s a way around that. With SSH, there’s a user-specific config file that allows you to set a default username for all of your SSH connections. In that configuration file, you can create entries for individual connections. An individual entry might look something like this:

Host ubuntu-invoice
   User jack
   Hostname 192.168.1.100
   IdentityFile ~/.ssh/id_rsa

In the above configuration, the following options are explained:

  • Host: The nickname used for the connection (so you could connect with simply ssh ubuntu-invoice).
  • User: The username for the connection.
  • Hostname: The IP address or domain for the connection.
  • IdentityFile: If you use SSH key authentication, this defines the key file used.

You can set up individual entries for every remote machine you connect to via SSH in this way, and it doesn’t matter how many entries you add to the file. On top of that, every entry can have different options.

However, we’re talking about setting a default username for all of your connections. Once you’ve set this option, any time you issue an SSH command without a username, it will assume what is set as the default in the config file is the username to apply. However, if you have individual entries that include a username, those entries will preempt the default. 

Also: The 6 best Macs

What do I mean by that? Let’s say you set the default SSH username in the config file to jack. Also, in the config file, you have this entry:

Host microk8s
   User olivia
   Hostname 192.168.1.70

If you issue the command ssh microk8s, SSH will apply the olivia username to the connection.

Let’s get this configuration up and running.

How to set up an SSH username in MacOS

The first thing to do is open the Terminal app. To do this, click the Launchpad in the MacOS Dock and search for and click to open the Terminal app.

From the Terminal window, open the configuration file for editing with the command:

At the top of the file, you’ll add an entry like this, where Username is the user you want to configure:

Once you’ve added that entry, save and close the file with the [Ctrl]+[X] keyboard combination.

Also: The basics of SSH usage

Now, when you go to connect to any server via SSH, you can leave out the username in the command. Of course, if the remote username is different than the default you’ve configured, simply add it to the command, bypassing the default configuration.



Source link


Warning: mysqli_query(): (HY000/1021): Disk full (/tmp/#sql_b0ff5_0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device") in /home/wirefan.com/public_html/wp-includes/class-wpdb.php on line 2349

Fatal error: Uncaught wfWAFStorageFileException: Unable to verify temporary file contents for atomic writing. in /home/wirefan.com/public_html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php:51 Stack trace: #0 /home/wirefan.com/public_html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php(658): wfWAFStorageFile::atomicFilePutContents('/home/wirefan.c...', '<?php exit('Acc...') #1 [internal function]: wfWAFStorageFile->saveConfig('livewaf') #2 {main} thrown in /home/wirefan.com/public_html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php on line 51