• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

New User Failed Run Kubectl with Error “The connection to the server xxx.xxx.xxx was refused – did you specify the right host or port?”

by admin

The Problem

When run kubectl from a new created user, failed with error:

The connection to the server xxx.xxx.xxx was refused - did you specify the right host or port?

The Solution

A newly created user has no KUBECONFIG configured. Setup kubernetes configuration for the new user:

# mkdir -p $HOME/.kube
# sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
# sudo chown $(id -u):$(id -g) $HOME/.kube/config

Filed Under: DevOps, Kubernetes

Some more articles you might also be interested in …

  1. How to resolve Docker Search Command Error – “getsockopt: no route to host” in CentOS / RHEL / Fedora
  2. How to Configure Btrfs as the Storage Engine in Docker
  3. “conda create” Command Examples
  4. How to List / Search / Pull docker images on Linux
  5. Python Quadratic Formula
  6. Examples of creating command alias in different shells
  7. How to Make a Variable read-only (constant) in Bash and Korn Shell
  8. Is there a CSS parent selector
  9. “docker save” Command Examples
  10. 10 Sed (Stream Editor) Command Examples

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright