<p>After the upgrading <code>kubectl</code>, I am unable to login on Openshift cluster.</p>
<p>When i am trying to login with <code>oc login</code> command it is reverting the below error message:</p>
<pre><code>Error: unknown command &quot;login&quot; for &quot;kubectl&quot;

 Did you mean this?

 logs
 plugin

 Run 'kubectl --help' for usage.
</code></pre>
<p>Below are the some details of version from machine where i have the login issue</p>
<pre><code># kubectl version

 Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;18&quot;, GitVersion:&quot;v1.18.0&quot;, GitCommit:&quot;9e991415386e4cf155a24b1da15becaa390438d8&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2020-03-25T14:58:59Z&quot;, GoVersion:&quot;go1.13.8&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}

 error: You must be logged in to the server (the server has asked for the client to provide credentials)
</code></pre>
<p>Below are the some details of version from machine where i have no issue , i am able to login and didn't upgrade kubectl version</p>
<pre><code># kubectl version

 Client Version: version.Info{Major:&quot;&quot;, Minor:&quot;&quot;, GitVersion:&quot;v0.0.0-master+$Format:%h$&quot;, GitCommit:&quot;$Format:%H$&quot;, GitTreeState:&quot;&quot;, BuildDate:&quot;1970-01-01T00:00:00Z&quot;, GoVersion:&quot;go1.12.12&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}

 Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;16+&quot;, GitVersion:&quot;v1.16.2+f2384e2&quot;, GitCommit:&quot;f2384e2&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2020-06-16T03:21:27Z&quot;, GoVersion:&quot;go1.12.12&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
</code></pre>
<p>Addition: I have checked by downgrade the <code>kubectl</code> versions , but getting same error on that machine where i unable to login using <code>oc login</code>.</p>

Imtiaz Ahmed
<p>It looks like you have symlinked <code>oc</code> to <code>kubectl</code> somehow.</p>
<p>As you note, <code>kubectl</code> does not have a <code>login</code> method, you need to actually use the <code>oc</code> CLI tool to log into your OpenShift cluster. This will get the proper tokens that you need to talk to the OpenShift API.</p>
<p>Alternatively, you can get the necessary token via the OpenShift Web Console (top right, &quot;Copy Login Command&quot; or something like that).</p>
