Flux rss
Search : in
By : Relevance Date Username
Statut : Not resolved

Change root user name

Diaa, on Monday July 7, 2008 11:05:49 AM
Hi all
My question is:
Is there a way to change the user account name as a way for more security.
(i.e, I am a root on RedHat system and want to change my username <root> to another name say <diaa>)
Is that possible.
Waiting for a response!
Reply to Diaa  Report this message to moderators Go to last message

1


  • This message seems useful, vote!
  • Report this message to moderators
Skewkus, on Monday July 7, 2008 03:51:50 PM
Yes it is possible,

Linux can be customize as you wish





Find below tips

The usermod command modifies the system account files to reflect the changes that are specified on the command line.

Options
The options which apply to the usermod command are:

-a, --append
Add the user to the supplemental group(s). Use only with -G option.
-c, --comment COMMENT
The new value of the user's password file comment field. It is normally modified using the chfn(1) utility.
-d, --home HOME_DIR
The user's new login directory. If the -m option is given the contents of the current home directory will be moved to the new home directory, which is created if it does not already exist.
-e, --expiredate EXPIRE_DATE
The date on which the user account will be disabled. The date is specified in the format YYYY-MM-DD.
-f, --inactive INACTIVE
The number of days after a password expires until the account is permanently disabled. A value of 0 disables the account as soon as the password has expired, and a value of -1 disables the feature. The default value is -1.
-g, --gid GROUP
The group name or number of the user's new initial login group. The group name must exist. A group number must refer to an already existing group. The default group number is 1.
-G, --groups GROUP1[,GROUP2,...[,GROUPN]]]
A list of supplementary groups which the user is also a member of. Each group is separated from the next by a comma, with no intervening whitespace. The groups are subject to the same restrictions as the group given with the -g option. If the user is currently a member of a group which is not listed, the user will be removed from the group. This behaviour can be changed via -a option, which appends user to the current supplementary group list.
-l, --login NEW_LOGIN
The name of the user will be changed from LOGIN to NEW_LOGIN. Nothing else is changed. In particular, the user's home directory name should probably be changed to reflect the new login name.
-L, --lock
Lock a user's password. This puts a '!' in front of the encrypted password, effectively disabling the password. You can't use this option with -p or -U.
-o, --non-unique
When used with the -u option, this option allows to change the user ID to a non-unique value.
-p, --password PASSWORD
The encrypted password, as returned by crypt(3).
-s, --shell SHELL
The name of the user's new login shell. Setting this field to blank causes the system to select the default login shell.
-u, --uid UID
The numerical value of the user's ID. This value must be unique, unless the -o option is used. The value must be non-negative. Values between 0 and 999 are typically reserved for system accounts. Any files which the user owns and which are located in the directory tree rooted at the user's home directory will have the file user ID changed automatically. Files outside of the user's home directory must be altered manually.
-U, --unlock
Unlock a user's password. This removes the '!' in front of the encrypted password. You can't use this option with -p or -L.
-Z, --selinux-user SEUSER
The SELinux user for the user's login. The default is to leave this field blank, which causes the system to select the default SELinux user.
Reply to Skewkus

2


  • This message seems useful, vote!
  • Report this message to moderators
 diaa, on Monday July 7, 2008 10:12:14 PM
THANKS
I appreciate your help
but I face error message as following:

~] #usermod -l newname root
usermod: can not lock password file
~] #

I'm working on RedHat 9, but I'm sure it's not the reason of this error message.
rather than the BIG trouble,that is this command will not be executed <as I read it online>
if the user named ( oldname ) is currently logged in.
I have to say that, I tried to change /etc/passwd permissions, but nothing changed, the error message still displayed.
waiting for reply.
Reply to diaa

Results for

Download Ant Renamer ANT Renamer allows to reappoint a big number of files and files in some clicks. It is only changing the names of files / files: Change of extension Replacement of character strings by others Insertion of a character string Displacement of... en.kioskea.net/telecharger/telecharger-396-ant-renamer
Graph for complicated data table Hello, i have a huge data base and i need to create a gantt chart (somehow automatic and if someone changes the name it should be changed in the graph automatically) i have names in column A ( here i have many project names like 5 times IBM, or 3... en.kioskea.net/forum/affich-31670-graph-for-complicated-data-table

Results for

Reinitializing the root password of MySQLReinitializing the root password of MySQL The root password is lost! Reinitializing the password: It’s important that you are able to access and modify the admin (root) password of MYSQL, either when installing MySQL for the first... en.kioskea.net/faq/sujet-630-reinitializing-the-root-password-of-mysql
Lock your Windows XP sessionLock your Windows XP session Method 1: Shortcut Method 2: Using DOS Method 3: Create a .bat file There are several ways available to be able to lock your Windows XP (including Home Edition and XP Pro) Method 1: Shortcut 1. With... en.kioskea.net/faq/sujet-520-lock-your-windows-xp-session
[BootLoader] System dual boot by default[BootLoader] System dual boot by default For Lilo For Grub From your "bootloader" to change the default system load up, proceed as follow: (note that all these procedures are run under "root") For Lilo Edit configuration file... en.kioskea.net/faq/sujet-734-bootloader-system-dual-boot-by-default

Results for

CHANGE HOST NAMEi want to know how to change my network host name .i'm using windows xp..please reply me as soon as possible en.kioskea.net/forum/affich-10760-change-host-name
Change file name (extensionHello, I have a folder with tens of thousands of ".html" files. I'm looking for a script that would give me the same result as if i right-clicked on every file, clicked on "rename", and then changed the ".html" to ".txt" (i want to import them... en.kioskea.net/forum/affich-13794-change-file-name-extension
HOW TO CHANGE OWNER NAMEHello, recently I acquired a used Mac OS X G-4, 10.4 without any disc. I already changed the administrator password, but the name of the previous owner still appearing everywhere. Folder with his name, on the email, keychain account... How can I reset... en.kioskea.net/forum/affich-31476-how-to-change-owner-name

Results for

Download BluefishYou like yourself well in the free world? You even decided to change your operating system? And now please create Websites? No worry, even under Linux or Mac, you can have an editor worthy of the name of Websites. Being surprising by its lightness,... en.kioskea.net/telecharger/telecharger-798-bluefish
Download Free PDF to Word ConverterDocuments PDF are certainly most on and the most stable for transfers, since they cannot be changed. However, sometimes they need data contained in a document PDF which they would like to edit or to change. Free PDF to Word Converter is as name... en.kioskea.net/telecharger/telecharger-572-free-pdf-to-word-converter
Download Instant File Name SearchAlthough mode searches already exist on Windows, sometimes more definite tools for specific tasks are needed. Instant Name Search Goes off search files by name on your computer or on a network instantly. It supports the Boolean operators (AND,or,... en.kioskea.net/telecharger/telecharger-630-instant-file-name-search

Results for

New internet domain names in 2009: ICANNPeople surf the Internet in Beijing in 2007. Internet users should soon be able to use new domain names such as .love, .paris or .bank if one of the world wide web's biggest shakeups is approved this week as expected by the web regulator ICANN.... en.kioskea.net/actualites/new-internet-domain-names-in-2009-icann-10478-actualite.php3

Results for

Windows NT - User management Windows NT is an operating system which manages sessions, meaning that when the system is started, it is necessary to log in with a user name and password. When Windows NT is installed, the administrator account is created by default, as is an... en.kioskea.net/winnt/ntusers.php3
Viruses - Magistr The Magistr virus (code name W32/Magistr.b@MM, I-Worm.Magistr.b.poly or PE_MAGISTR.B) is a polymorphic worm (a worm whose shape, or more precisely signature, is constantly changing) which spreads using email. It is a variant on the Disemboweler worm... en.kioskea.net/virus/magistr.php3
Internet - Domain names Each computer directly connected to the Internet has at least one specific IP address. However, users do not want to work with numerical addresses such as 194.153.205.26 but with a domain name or more specifically addresses (called FQDN addresses)... en.kioskea.net/internet/dns.php3