修改 树莓派 默认的 Pi 账号

4,396 views次阅读
没有评论

树莓派 默认账号 是 pi ,用起来老不习惯了,还是改一下舒服啊。

 

首先需要启用root账号

sudo passwd toor

sudo passwd --unlock root

这里的toor是密码,当然可以设置别的自己习惯就好。

设置 root 密码后,退出当前的 pi 用户。以 root 身份登录。

 

先修改 user

usermod -l yourname pi

 

再修改 group

groupmod -n yourname pi

 

再把 home 目录改掉

mv /home/pi /home/yourname

 

设置一下 home 目录

usermod -d /home/yourname yourname

 

好了,现在可以用新账号登录。资料完全是原来的 pi 的。

 

最后,为了安全起见,还是禁用掉 root。

sudo passwd -l root

正文完
 0
HopoL
版权声明:本站原创文章,由 HopoL 于2016-01-19发表,共计331字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)

HopoL's Blog

文章搜索
最新评论
Metaldololity Metaldololity Whoa, that's really simple. You just save my time a lot. Thankyou!
HopoL HopoL Since you’ve got the backup, it’s actually pretty simple. Just restore the backup files to your new flash drive, then head over to the /config directory and edit the go file. Look for export UNRAID_GUID=xxxxxxxxxxxxxx and swap it with your new drive's GUID. That should do the trick!
Metaldololity Metaldololity Really apreciate for your fast respond, mate. I actually have the backup of the flashdrive (from regular unraid backup). The problem is, when i search on youtube tutorial about changing the failed flashdrive, the process need some sort of confirmation with an account in unraid (blacklist the old one -> whitelist the new one). Since i have a cracked unraid, i don't know how to register my new flashdrive as the correct one (and the system not asking me for the old failed flashdrive). Thanks in advance
HopoL HopoL Man, that's a tough spot to be in. Regularly backing up your /boot folder is super important for exactly this reason. If you don't have a backup and your flash drive is completely fried, your best bet is to Google some specific recovery guides or check the Unraid forums. There are ways to rebuild your config by identifying your parity and data drives, but it can be a bit of a process. Hope you can get it sorted!
Metaldololity Metaldololity Hi! Huge thanks for the update on 7.2.0. I have question here, my flashdrive corrupted. how do i install it on the new flashdrive without losing all my configuration?