User Tools

Site Tools


linux

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux [2026/03/01 19:37] reddylinux [2026/05/02 18:11] (current) reddy
Line 3: Line 3:
 ===== Popular Topics ===== ===== Popular Topics =====
  
 +  * [[bash]]
 +  * [[bind]]
 +  * [[chrony]]
   * [[Docker]]   * [[Docker]]
 +  * [[diff]]
 +  * [[FirewallD]]
   * [[Git]]   * [[Git]]
 +  * [[keepalive]]
 +  * [[lxc]]
 +  * [[mail]]
   * [[rsync]]   * [[rsync]]
   * [[Samba]]   * [[Samba]]
 +  * [[SELinux]]
   * [[SystemD Unit Files]]   * [[SystemD Unit Files]]
   * [[tuned]]   * [[tuned]]
 +  * [[ufw]]
   * [[Vim]]   * [[Vim]]
   * [[VNC]]   * [[VNC]]
Line 82: Line 92:
 </code> </code>
  
-==== ssh-copy-id: Auth with another key ====+==== ssh-copy-id ====
  
 <code> <code>
 ssh-keygen -f key_file_name ssh-keygen -f key_file_name
 +
 +# To make it non-interactive (we cannot pass the StrictHostKeychecking so we direct the "yes")
 +sshpass -p mypassword ssh-copy-id -i key_file_name.pub myuser@myserver <<< yes
  
 # ssh-copy-id doesn't directly support auth with another key # ssh-copy-id doesn't directly support auth with another key
 # ...but it passes along options to ssh # ...but it passes along options to ssh
 ssh-copy-id -i ~/.ssh/id_rsa.nondefault -o 'IdentityFile ~/vm-key' user@remote ssh-copy-id -i ~/.ssh/id_rsa.nondefault -o 'IdentityFile ~/vm-key' user@remote
- 
-# To make it non-interactive (we cannot pass the StrictHostKeychecking so we direct the "yes") 
-sshpass -p mypassword ssh-copy-id -i key_file_name.pub myuser@myserver <<< yes 
  
 # This can also be done with ssh-agent # This can also be done with ssh-agent
Line 101: Line 111:
 </code> </code>
  
 +==== Setting DNS server ====
 +
 +Use the Network Manager CLI as follows.
 +
 +List connections with:
 +<code>
 +nmcli c
 +</code>
 +
 +Using the connection name, look at the configured DNS servers:
 +<code>
 +nmcli c show 'cloud-init ens5' | grep ipv4.dns
 +</code>
 +
 +Set the new DNS servers
 +<code>
 +nmcli c modify 'cloud-init ens5' ipv4.dns '127.0.0.1,8.8.8.8'
 +nmcli c modify 'cloud-init ens5' ipv4.ignore-auto-dns yes
 +# The above commands are an alternative to modifying the config file at
 +# /etc/NetworkManager/system-connections/ens5.nmconnection
 +</code>
 +
 +For the change to take effect:
 +<code>
 +nmcli c down 'cloud-init ens5' && nmcli c up 'cloud-init ens5'
 +</code>
  
 +These settings also exist at the device level ("nmcli d", "nmcli d show ens5 | grep IP4.DNS") but we generally set these at the connection level.
linux.1772390260.txt.gz · Last modified: by reddy

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki