特殊:Badtitle/NS100:UbuntuLTSP/CreateChrootAdminAcct

来自Ubuntu中文
Wikibot留言 | 贡献2009年11月17日 (二) 20:51的版本 (创建新页面为 '{{From|https://help.ubuntu.com/community/UbuntuLTSP/CreateChrootAdminAcct}} {{Languages|UbuntuHelp:UbuntuLTSP/CreateChrootAdminAcct}} {|border="1" cellspacing="0" |This page is ...')
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳到导航跳到搜索
可打印版本不再受到支持且可能有渲染错误。请更新您的浏览器书签并改用浏览器默认打印功能。

{{#ifexist: :UbuntuLTSP/CreateChrootAdminAcct/zh | | {{#ifexist: UbuntuLTSP/CreateChrootAdminAcct/zh | | {{#ifeq: {{#titleparts:UbuntuLTSP/CreateChrootAdminAcct|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:UbuntuLTSP/CreateChrootAdminAcct|1|-1|}} | zh | | }}

This page is specific to Ubuntu versions 8.04 and 9.04

If you find this information applicable to additional versions/releases, please edit this page and modify this header to reflect that. Please also include any necessary modifications for this information to apply to the additional versions.


NOTE: Please use this page as a reference for other pages instead of simply copying the code.


Create admin account

By default in Ubuntu (server and chroot filesystems), the 'root' account is locked and users are advised to use 'sudo' to perform administrative tasks. This is a good idea. This page is dedicated to creating an administrative user account in the LTSP client chroot environment. To become root, the adminname user only needs to:

sudo -s -H
  • Create an adminname account inside the chroot:
  • NOTE: In the visudo step add to end of /etc/sudoers file:
# Members of the sudo group may gain root privileges
%sudo ALL=(ALL) ALL
sudo -s -H
chroot /opt/ltsp/i386
useradd -m adminname -G sudo
passwd adminname
visudo
exit
exit
  • Lastly, update the client image to reflect the changes we just made:
sudo ltsp-update-image

How to 'lock' the account

sudo chroot /opt/ltsp/i386 passwd -l adminname
sudo ltsp-update-image

How to 'unlock' the account

sudo chroot /opt/ltsp/i386 passwd -u adminname
sudo ltsp-update-image

Additional security measure

Disable root login by editing sshd_config

sudo vi /opt/ltsp/i386/etc/ssh/sshd_config

Change PermitRootLogin to no:

PermitRootLogin no

Maybe add a security Banner

#Banner /etc/issue.net
Banner /etc/ssh/warning

Then create the warning file:

sudo vi /opt/ltsp/i386/etc/ssh/warning

Something like:

*** WARNING ***
THIS SYSTEM IS RESTRICTED TO AUTHORIZED USERS FOR AUTHORIZED USE ONLY.

Finally again

sudo ltsp-update-image