Sponsored Content
Full Discussion: MSYS2 on Windows 7 VM
Special Forums Windows & DOS: Issues & Discussions MSYS2 on Windows 7 VM Post 302947366 by mrm5102 on Wednesday 17th of June 2015 12:54:00 PM
Old 06-17-2015
Bump....


Update:
Not sure I did this correctly or if it's going to mess anything up later on down the road, but I made a slight workaround... Haven't actually changed the existing Username, which I want to do but after reading some stuff for Cygwin, which is what MSYS is built off of I believe, it said the User in Cygwin is directly linked to that of your Window's User. So any files/folders will also be owned by your Windows User, or something along those lines...

But anyway, since MSYS does not create a /etc/passwd file, I ran the command
Code:
/usr/bin/mkpasswd  >  /etc/passwd

which created the passwd file using all existing user information. Then I simply modified the HOME dir portion of my User's line in /etc/passwd to a 'first intial last name' format, like "/home/flastname".

Then I copied everything from the old HOME dir to the new one using these 2 commands. Needed both because the first cp did not copy hidden files...
Code:
# cp -R /home/First*/* /home/flastname/
# cp -R /home/First*/.* /home/flastname/

After I did all that and I opened a new MSYS terminal, I was automatically taken to the NEW home dir by default.

I would still love to be able to change the Username itself if at all possible, but still have not found any instructions on how to do so.

I did however read an interesting article on someone trying to do this with Cygwin and what they did was:
1st) They installed Cygwin completely.
2nd) After the installation and before opening Cygwin for the first time they said they opened "/etc/passwd" and found the line containing their default Window's User and changed the username to something without whitespace, like the first initial and lastname format.
3rd) They opened the Cygwin terminal for the first time and Ta-Da, the new username was used instead...

Does that sound like something I should try? Could something like that mess-up anything else? Maybe file permissions, or something along those lines...? I would just hate to have to re-download any packages I've installed or re-do any modifications I made to the system already

Or... Maybe there is a way to "trick" MSYS into thinking it's the first time I'm opening MSYS and I could try the above, any idea..?

Thanks,
Matt
 

3 More Discussions You Might Find Interesting

1. Programming

[MSYS2/GCC-TDM] Compiler not finding headers in /usr/local/include

I hope it's okay to post this here. I'm working on Windows computer but using the Unix-like environment MSYS2 (https://sourceforge.net/projects/msys2). My problem is that I can't get the compiler to find headers located in /usr/local/include. I am trying to compile libpng which wants the header... (1 Reply)
Discussion started by: AntumDeluge
1 Replies

2. Windows & DOS: Issues & Discussions

UNIX for Advanced & Expert Users > I tried to build libtiff on MSYS2+minGW but found an interruption

When I tried to build libtiff on MSYS2+minGW and opened the MSYS2 shell, got error: $ ./configure configure: loading site script /etc/config.site checking build system type... Invalid configuration `x86_64-pc-msys': system `msys' not recognized configure: error: /bin/sh config/config.sub... (1 Reply)
Discussion started by: abdulbadii
1 Replies

3. Windows & DOS: Issues & Discussions

Can I replace the gcc, and along with all other binaries, in MSYS2 minGW64 with the MinGW64 Project

Can I replace the gcc, and along with all other binaries too, in MSYS2 minGW64 with ones by MinGW64 Project Can i safely replace the gcc, if asked, telling its version: gcc.exe (Rev2, Built by MSYS2 project) 6.2.0 Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see... (1 Reply)
Discussion started by: abdulbadii
1 Replies
mkpasswd(8)						      System Manager's Manual						       mkpasswd(8)

NAME
mkpasswd - Creates a version of the basic user database organized for efficient searches SYNOPSIS
/usr/sbin/mkpasswd [-v] [-s size] passwdfile DESCRIPTION
The mkpasswd command creates an auxiliary version of the basic user database in a form organized for efficient searches by the getpwuid subroutine and the getpwnam subroutine. The mkpasswd command reads the user attributes in the /etc/passwd file and creates a hashed pass- word database in the /etc/passwd.dir and /etc/passwd.pag files (see ndbm(3) reference page). If you specify a file other than /etc/passwd, the command reads the user attributes in that file and creates a hashed password database in the passwdfile.dir and passwdfile.pag files. It is important to know that the password file you designate must be in password file format (see the passwd(4) reference page). Note that if you use the vipw command to edit a password file, you do not need to use the mkpasswd command. This is because the vipw com- mand automatically invokes the mkpasswd command which in turn creates the /etc/passwd.dir and /etc/passwd.pag files. Only the root user should have execute access to the mkpasswd command. Files accessed: File /etc/passwd /etc/passwd.pag /etc/passwd.dir passwdfile passwdfile.pag passwdfile.dir The mkpasswd command may fail with a errno value of EFBIG if the password file is large (30,000 entries or more). This failure can be avoided by using the -s option to set a larger page block size for the hashed database. FLAGS
Specifies that each stored entry be listed on standard output Specifies the page block size to use in creating the hashed password data- base. The size argument is a value from 1 to 32, representing page block sizes from 1024 to 32768, respectively. The default page block size is 1024. EXAMPLES
If you have not used vipw to edit the /etc/passwd and wish to generate a hashed password database, enter the following: /usr/sbin/mkpasswd -v /etc/passwd An auxiliary version of the basic user database (/etc/passwd.dir and /etc/passwd.pag files) is created with a hashing algo- rithm. To create a hashed password database with a page block size of 8192, enter the following: /usr/sbin/makepasswd -s 8 /etc/passwd SECURITY NOTE
If enhanced security is running on your system, the passwords are stored in the extended attributes database. See the Security guide for more information about passwords in the enhanced security environment. RETURN VALUES
The mkpasswd command exits with a nonzero exit code if any errors are detected. ERRORS
If the mkpasswd request is not successful, the following error message is displayed: The passwdfile.dir and passwdfile.pag files already exist from a previous execution of the same mkpasswd command. FILES
Specifies the command path RELATED INFORMATION
Commands: adduser(8), passwd(1), passwd(4), vipw(8) Functions: getpwent(3), ndbm(3) Manuals: Security delim off mkpasswd(8)
All times are GMT -4. The time now is 02:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy