Lost access to a user profile

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read how to get help
Post Reply
simakma5
Level 1
Level 1
Posts: 5
Joined: Mon Aug 26, 2019 7:57 pm

Lost access to a user profile

Post by simakma5 » Mon Aug 26, 2019 8:05 pm

Following a site about changing the hostname, in my etc folder, I've changed the hostname in files "hostname" and "hosts" using the root terminal. Later after I rebooted my system, Linux Mint didn't offer me to log in with my account, but instead, it forced me to create a new one. When I did so, it loaded into a fresh new account as if I never used Linux Mint before. I know I probably shouldn't have tampered with the root terminal, but is there some way to recover my previous account? I lost all my files thanks to this foolishness of mine.

deck_luck
Level 3
Level 3
Posts: 190
Joined: Mon May 27, 2019 6:57 pm
Location: here

Re: Lost access to a user profile

Post by deck_luck » Mon Aug 26, 2019 10:09 pm

Did you check the /home directory to see if you original account was there?

Code: Select all

ls -l /home 
sudo ls - l /home/original_account
💡Give a man a fish, and you feed him for a day. Teach a man to fish, and you feed him for a lifetime. ✝️

simakma5
Level 1
Level 1
Posts: 5
Joined: Mon Aug 26, 2019 7:57 pm

Re: Lost access to a user profile

Post by simakma5 » Tue Aug 27, 2019 3:41 am

Unfortunately yes and it couldn't find anything.

gm10
Level 18
Level 18
Posts: 8722
Joined: Thu Jun 21, 2018 5:11 pm

Re: Lost access to a user profile

Post by gm10 » Tue Aug 27, 2019 4:05 am

Can't say what happened to your files because we don't know what commands you ran (maybe check the history of the root user), it's possible you just moved them elsewhere or mounted a different path to /home, but just for reference, the proper way to change your hostname is (in a non-root terminal of an admin user):

Code: Select all

hostnamectl set-hostname YOURNEWNAME
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

deck_luck
Level 3
Level 3
Posts: 190
Joined: Mon May 27, 2019 6:57 pm
Location: here

Re: Lost access to a user profile

Post by deck_luck » Tue Aug 27, 2019 5:49 am

How quickly do you need to get your files back? If you have a dead line to meet then you should use your backups to restore the files you needed. Otherwise, we can try to work through and make some sense out of this situation.
Later after I rebooted my system, Linux Mint didn't offer me to log in with my account, but instead, it forced me to create a new one. When I did so, it loaded into a fresh new account as if I never used Linux Mint before.
How did Linux Mint force you to create a new account? Do you mean you had to manually create a new account? Or did it go through the same set of questions like you were doing a fresh install? Please be very specific with your response.

Please post the output from the following commands:

Code: Select all


lsblk -So +size

lsblk -f 

cat /etc/fstab

df -h

sudo ls -lAd /home

sudo ls -lAd /home/* 

sudo ls -l /var/log/installer/syslog

💡Give a man a fish, and you feed him for a day. Teach a man to fish, and you feed him for a lifetime. ✝️

simakma5
Level 1
Level 1
Posts: 5
Joined: Mon Aug 26, 2019 7:57 pm

Re: Lost access to a user profile

Post by simakma5 » Tue Aug 27, 2019 9:10 am

Sorry for the lack of details. I had to go through a set of questions, but didn't have to install the OS (so I wasn't asked to create any partitions etc.). The questions were only regarding my internet access, name, hostname etc.

As for the commands, the results:

lsblk -So +size

Code: Select all

NAME HCTL       TYPE VENDOR   MODEL             REV TRAN     SIZE
sda  0:0:0:0    disk ATA      TOSHIBA MQ04ABF1 0J   sata   931,5G
sdb  1:0:0:0    disk ATA      TOSHIBA THNSNK12 4102 sata   119,2G
lsblk -f

Code: Select all

NAME   FSTYPE LABEL    UUID                                 MOUNTPOINT
sda                                                         
├─sda1 ntfs   DATA     01D55BF40A027A20                     /media/simakma5/DATA
├─sda2 ext4            f5b20dcb-e17d-4885-8048-ab0d0de4db24 /
├─sda3 swap            767dc06b-a062-452f-8b5e-a5009d94f050 [SWAP]
└─sda4 ext4            fc13971e-12d0-47f5-a5a1-e9ace77fc93e /home
sdb                                                         
├─sdb1 vfat   SYSTEM   64BA-DA0A                            /boot/efi
├─sdb2                                                      
├─sdb3 ntfs   WIN      01D4F0F080C8FD60                     
└─sdb5 ntfs   RECOVERY 7A4642DE46429B31
cat /etc/fstab

Code: Select all

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=f5b20dcb-e17d-4885-8048-ab0d0de4db24 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sdb1 during installation
UUID=64BA-DA0A  /boot/efi       vfat    umask=0077      0       1
# /home was on /dev/sda4 during installation
UUID=fc13971e-12d0-47f5-a5a1-e9ace77fc93e /home           ext4    defaults        0       2
# swap was on /dev/sda3 during installation
UUID=767dc06b-a062-452f-8b5e-a5009d94f050 none            swap    sw              0       0
df -h

Code: Select all

Filesystem      Size  Used Avail Use% Mounted on
udev            3,9G     0  3,9G   0% /dev
tmpfs           787M  1,6M  785M   1% /run
/dev/sda2        20G  7,3G   12G  40% /
tmpfs           3,9G  114M  3,8G   3% /dev/shm
tmpfs           5,0M  4,0K  5,0M   1% /run/lock
tmpfs           3,9G     0  3,9G   0% /sys/fs/cgroup
/dev/sdb1       256M   31M  226M  12% /boot/efi
/dev/sda4       121G  786M  114G   1% /home
tmpfs           787M   68K  787M   1% /run/user/1000
/dev/sda1       781G  443G  339G  57% /media/simakma5/DATA
sudo ls -lAd /home

Code: Select all

drwxr-xr-x 4 root root 4096 Aug 27 01:23 /home
sudo ls -lAd /home/*

Code: Select all

drwx------  2 root     root     16384 Aug 26 14:06 /home/lost+found
drwxr-xr-x 27 simakma5 simakma5  4096 Aug 27 09:48 /home/simakma5
sudo ls -l /var/log/installer/syslog

Code: Select all

-rw------- 1 syslog adm 500218 Aug 26 14:17 /var/log/installer/syslog

simakma5
Level 1
Level 1
Posts: 5
Joined: Mon Aug 26, 2019 7:57 pm

Re: Lost access to a user profile

Post by simakma5 » Tue Aug 27, 2019 9:16 am

gm10 wrote:
Tue Aug 27, 2019 4:05 am
Can't say what happened to your files because we don't know what commands you ran (maybe check the history of the root user), it's possible you just moved them elsewhere or mounted a different path to /home, but just for reference, the proper way to change your hostname is (in a non-root terminal of an admin user):

Code: Select all

hostnamectl set-hostname YOURNEWNAME
Thank you very much, that's for the next time!

simakma5
Level 1
Level 1
Posts: 5
Joined: Mon Aug 26, 2019 7:57 pm

Re: Lost access to a user profile

Post by simakma5 » Tue Aug 27, 2019 9:22 am

Alright guys, thank you so much for your quick and very good responses. Anyway, I've managed to recover almost all of my files (and more importantly, all the important ones) simply by finding an internet backup I've made a few days ago and I'll just go with using the new account into which I've already imported all the previous files.

deck_luck
Level 3
Level 3
Posts: 190
Joined: Mon May 27, 2019 6:57 pm
Location: here

Re: Lost access to a user profile

Post by deck_luck » Tue Aug 27, 2019 4:01 pm

It looks like you did an installation on 20190826 around 14:10.
💡Give a man a fish, and you feed him for a day. Teach a man to fish, and you feed him for a lifetime. ✝️

Post Reply

Return to “Other topics”