lost user password, disabled root login. no sudo access

January 18, 2016 650 views
Security Linux Basics Ubuntu

On ubuntu 14.04 with an admin user created.
I have created a key for ssh and can login with my user without a password prompt.
However i lost the password, and also hardened the root user login.

When i reset root password from the web panel, i am able to login, and prompted with to create mandatory new password. I do that and am immedidatly looged out and a new login propmt appears. When i enter my new password for root,i am responded with "login incorrect".

1 Answer

The problem is you are prompted for the new password AGAIN, and if you fail, the prompt exists.

Its hard trying it by hand so you can try this code in developer tools :

var sendString = (function(rfb, force, sendDelay) { 
  sendDelay = sendDelay || 25;
  var _q = [];
  var _qStart = function() {
    var chr = _q.shift();
    if (chr) {
      setTimeout(_qStart, sendDelay);
  var _qStop = function() { _q.length = 0; };
  var fn = function sendString(str) {
    str = str || '';
    var chr;
    for (var i=0; i < str.length; i++) {
      chr = str[i].charCodeAt();
  if (rfb.sendString && true !== force) {
    console.warn('rfb.sendString not installed because it already exists.  Use force if you\'d like');
  else {
    rfb.sendString = fn;
  return fn;

then send text with sendString('yourletters');

Have another answer? Share your knowledge.