Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Issues with user accounts and logging in.
New Posts  All Forums:Forum Nav:

Issues with user accounts and logging in.

post #1 of 9
Thread Starter 
Was wondering if anyone's experience this problem before. I'm trying to write a script that automates user account creation but that isn't really the issue. I'll get extra credit if I can automate the password creation process.

But heres the thing, I know how to do it, but just to test things out if I make multiple user accounts with useradd in the terminal, and then set their password using passwd, to something dumb like dog12345, then I can't login to those users via the terminal, but I can login through the GUI for example if I log out of my current user and switch over to them.

Anytime I do exit from root and type "login", then type in the correct information, it tells me login incorrect. Neither caps lock or numlock are on.

Any ideas?
Gaymen Rig
(15 items)
 
  
CPUMotherboardGraphicsRAM
Core i5 2500k ASRock P67 Extreme4 Gen3 Display driver has stopped and has recovered 7970 8GB G.Skill Ripjaws DDR3 @1600 Mhz 
Hard DriveCoolingOSMonitor
x1 Corsair Force 3 180GB SSD, x2 Spinpoint F3 1TB NH-D14 Windows 8 Pro ASUS VW266H 26" LCD, 22" 1080p AOC, 22" Emprex 
KeyboardPowerCaseMouse
Cooler Master Quickfire TK Reds 850W XFX Black Edition Cooler Master HAF XB Logitech G700 
Audio
ATH-m50s 
  hide details  
Reply
Gaymen Rig
(15 items)
 
  
CPUMotherboardGraphicsRAM
Core i5 2500k ASRock P67 Extreme4 Gen3 Display driver has stopped and has recovered 7970 8GB G.Skill Ripjaws DDR3 @1600 Mhz 
Hard DriveCoolingOSMonitor
x1 Corsair Force 3 180GB SSD, x2 Spinpoint F3 1TB NH-D14 Windows 8 Pro ASUS VW266H 26" LCD, 22" 1080p AOC, 22" Emprex 
KeyboardPowerCaseMouse
Cooler Master Quickfire TK Reds 850W XFX Black Edition Cooler Master HAF XB Logitech G700 
Audio
ATH-m50s 
  hide details  
Reply
post #2 of 9
What distro? And where's your script?
Underground
(14 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 920 C0 ASUS P6T6 WS Revolution GTX 460 TR3X6G1600C8D 
Hard DriveOptical DriveCoolingOS
WD1001FALS SAMSUNG SH-S223F 22X DVD MULTI Corsair H50 Fedora 16 KDE x86_64 
MonitorKeyboardPowerCase
HP w19b Microsoft Comfort Curve Corsair CX600 Thermaltake Armor VA8003BWS 
MouseMouse Pad
Razer DeathAdder Black 
  hide details  
Reply
Underground
(14 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 920 C0 ASUS P6T6 WS Revolution GTX 460 TR3X6G1600C8D 
Hard DriveOptical DriveCoolingOS
WD1001FALS SAMSUNG SH-S223F 22X DVD MULTI Corsair H50 Fedora 16 KDE x86_64 
MonitorKeyboardPowerCase
HP w19b Microsoft Comfort Curve Corsair CX600 Thermaltake Armor VA8003BWS 
MouseMouse Pad
Razer DeathAdder Black 
  hide details  
Reply
post #3 of 9
Thread Starter 
fedora 14

#!/bin/bash
echo "Please enter the filename containing student information."
read INFO_FILE
if [ -f $INFO_FILE ]
then
while read studentLine
do
username="$(echo $studentLine | cut -d: -f1)"
studentinfo="$(echo $studentLine | cut -d: -f2)"
defshell="$(echo $studentLine | cut -d: -f3)"
studentid="$(echo $studentLine | cut -d: -f4)"
nameTest="$(echo $username | cut -c1-1 >tempGroupFile)"
while read groupLine
do
firstChar="$(echo $groupLine | cut -c1-1)"
if [ "$firstChar" = "a" -o "$firstChar" = "b" -o "$firstChar" = "c" -o "$firstChar" = "d" -o "$firstChar" = "e" ]
then
useradd -m -u $studentid -s $defshell -c "$studentinfo" -g sce $username
cp /etc/login.defs /home/$username; cp /etc/profile /home/$username
echo "$username$studentid" | passwd --stdin $username
elif [ "$firstChar" = "f" -o "$firstChar" = "g" -o "$firstChar" = "h" -o "$firstChar" = "i" -o "$firstChar" = "j" ]
then
useradd -m -u $studentid -s $defshell -c "$studentinfo" -g edu $username
cp /etc/login.defs /home/$username; cp /etc/profile /home/$username
echo "$username$studentid" | passwd --stdin $username
elif [ "$firstChar" = "k" -o "$firstChar" = "l" -o "$firstChar" = "m" -o "$firstChar" = "n" ]
then
useradd -m -u $studentid -s $defshell -c "$studentinfo" -g bus $username
cp /etc/login.defs /home/$username; cp /etc/profile /home/$username
echo "$username$studentid" | passwd --stdin $username
elif [ "$firstChar" = "o" -o "$firstChar" = "p" -o "$firstChar" = "q" -o "$firstChar" = "r" -o "$firstChar" = "s" ]
then
useradd -m -u $studentid -s $defshell -c "$studentinfo" -g bio $username
cp /etc/login.defs /home/$username; cp /etc/profile /home/$username
echo "$username$studentid" | passwd --stdin $username
elif [ "$firstChar" = "t" -o "$firstChar" = "u" -o "$firstChar" = "v" -o "$firstChar" = "w" -o "$firstChar" = "x" -o "$firstChar" = "y" -o "$firstChar" = "z" ]
then
useradd -m -u $studentid -s $defshell -c "$studentinfo" -g math $username
cp /etc/login.defs /home/$username; cp /etc/profile /home/$username
echo "$username$studentid" | passwd --stdin $username
fi
done <tempGroupFile
done <$INFO_FILE
else
echo "$INFO_FILE does not exist."
fi
Gaymen Rig
(15 items)
 
  
CPUMotherboardGraphicsRAM
Core i5 2500k ASRock P67 Extreme4 Gen3 Display driver has stopped and has recovered 7970 8GB G.Skill Ripjaws DDR3 @1600 Mhz 
Hard DriveCoolingOSMonitor
x1 Corsair Force 3 180GB SSD, x2 Spinpoint F3 1TB NH-D14 Windows 8 Pro ASUS VW266H 26" LCD, 22" 1080p AOC, 22" Emprex 
KeyboardPowerCaseMouse
Cooler Master Quickfire TK Reds 850W XFX Black Edition Cooler Master HAF XB Logitech G700 
Audio
ATH-m50s 
  hide details  
Reply
Gaymen Rig
(15 items)
 
  
CPUMotherboardGraphicsRAM
Core i5 2500k ASRock P67 Extreme4 Gen3 Display driver has stopped and has recovered 7970 8GB G.Skill Ripjaws DDR3 @1600 Mhz 
Hard DriveCoolingOSMonitor
x1 Corsair Force 3 180GB SSD, x2 Spinpoint F3 1TB NH-D14 Windows 8 Pro ASUS VW266H 26" LCD, 22" 1080p AOC, 22" Emprex 
KeyboardPowerCaseMouse
Cooler Master Quickfire TK Reds 850W XFX Black Edition Cooler Master HAF XB Logitech G700 
Audio
ATH-m50s 
  hide details  
Reply
post #4 of 9
I don't see any problems with your script. But on re-reading your original question, I do see a problem here:

Quote:
Originally Posted by Dark-Asylum View Post
Anytime I do exit from root and type "login", then type in the correct information, it tells me login incorrect. Neither caps lock or numlock are on.
login isn't meant to be run as a normal user. If you want to test text-only logins, switch to a console and try it there.
Underground
(14 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 920 C0 ASUS P6T6 WS Revolution GTX 460 TR3X6G1600C8D 
Hard DriveOptical DriveCoolingOS
WD1001FALS SAMSUNG SH-S223F 22X DVD MULTI Corsair H50 Fedora 16 KDE x86_64 
MonitorKeyboardPowerCase
HP w19b Microsoft Comfort Curve Corsair CX600 Thermaltake Armor VA8003BWS 
MouseMouse Pad
Razer DeathAdder Black 
  hide details  
Reply
Underground
(14 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 920 C0 ASUS P6T6 WS Revolution GTX 460 TR3X6G1600C8D 
Hard DriveOptical DriveCoolingOS
WD1001FALS SAMSUNG SH-S223F 22X DVD MULTI Corsair H50 Fedora 16 KDE x86_64 
MonitorKeyboardPowerCase
HP w19b Microsoft Comfort Curve Corsair CX600 Thermaltake Armor VA8003BWS 
MouseMouse Pad
Razer DeathAdder Black 
  hide details  
Reply
post #5 of 9
Thread Starter 
yeah i had seen that when i was playing around in the ttys. thank you for coming back and confirming it with me
Gaymen Rig
(15 items)
 
  
CPUMotherboardGraphicsRAM
Core i5 2500k ASRock P67 Extreme4 Gen3 Display driver has stopped and has recovered 7970 8GB G.Skill Ripjaws DDR3 @1600 Mhz 
Hard DriveCoolingOSMonitor
x1 Corsair Force 3 180GB SSD, x2 Spinpoint F3 1TB NH-D14 Windows 8 Pro ASUS VW266H 26" LCD, 22" 1080p AOC, 22" Emprex 
KeyboardPowerCaseMouse
Cooler Master Quickfire TK Reds 850W XFX Black Edition Cooler Master HAF XB Logitech G700 
Audio
ATH-m50s 
  hide details  
Reply
Gaymen Rig
(15 items)
 
  
CPUMotherboardGraphicsRAM
Core i5 2500k ASRock P67 Extreme4 Gen3 Display driver has stopped and has recovered 7970 8GB G.Skill Ripjaws DDR3 @1600 Mhz 
Hard DriveCoolingOSMonitor
x1 Corsair Force 3 180GB SSD, x2 Spinpoint F3 1TB NH-D14 Windows 8 Pro ASUS VW266H 26" LCD, 22" 1080p AOC, 22" Emprex 
KeyboardPowerCaseMouse
Cooler Master Quickfire TK Reds 850W XFX Black Edition Cooler Master HAF XB Logitech G700 
Audio
ATH-m50s 
  hide details  
Reply
post #6 of 9
Quote:
Originally Posted by Dark-Asylum View Post
yeah i had seen that when i was playing around in the ttys. thank you for coming back and confirming it with me
this is off topic... but your sig lies what about old people with colostomy bags?
Kinda meh now...
(13 items)
 
  
CPUMotherboardGraphicsRAM
PhII 940 BE asus M4N82 Deluxe 2x 8800gts(g92) 2x 1g ocz ddr2 1066 
Hard DriveOptical DriveOSMonitor
/dev/sd[abc] /dev/sr0 WinXP/Linux 22in acer 
PowerCaseMouseMouse Pad
950w rosewill timebomb Antec 900 (2small) Voodoo Deathadder (RED!) X-Trac Pads Ripper XL 
  hide details  
Reply
Kinda meh now...
(13 items)
 
  
CPUMotherboardGraphicsRAM
PhII 940 BE asus M4N82 Deluxe 2x 8800gts(g92) 2x 1g ocz ddr2 1066 
Hard DriveOptical DriveOSMonitor
/dev/sd[abc] /dev/sr0 WinXP/Linux 22in acer 
PowerCaseMouseMouse Pad
950w rosewill timebomb Antec 900 (2small) Voodoo Deathadder (RED!) X-Trac Pads Ripper XL 
  hide details  
Reply
post #7 of 9
Quote:
Originally Posted by EntTheGod View Post
this is off topic... but your sig lies what about old people with colostomy bags?
No. Defecation is the process of removing waste from the bowels. Even doing so surgically by means of ostomy is considered defecation.
Gaming Rig
(20 items)
 
  
CPUMotherboardGraphicsRAM
Intel 2500k, 4.6GHz, 1.304v ASRock P67 Extreme4 Gen3 2x Sapphire HD7970 OC with Boost, 1150 MHz/1550... 2x4GB DDR3 1600 Corsair Vengeance 
Hard DriveHard DriveHard DriveOptical Drive
Samsung 840 Pro Samsung 750GB HD753LJ Samsung F3 ASUS 24X DVD Combo Drive 
CoolingOSMonitorKeyboard
Noctua DH14 Windows 8 Professional x64 Crossover 27Q 27" IPS LED, 2560x1440 Logitech G11 
PowerCaseMouseMouse Pad
Corsair TX750 Cooler Master HAF932 Logitech G500 Custom 
AudioAudioAudioAudio
Creative X-Fi Titanium Fatal1ty 2x Dayton B652 Bookshelf Dayton DTA-100A Amplifier Dayton 12" SUB-1200 Subwoofer 
  hide details  
Reply
Gaming Rig
(20 items)
 
  
CPUMotherboardGraphicsRAM
Intel 2500k, 4.6GHz, 1.304v ASRock P67 Extreme4 Gen3 2x Sapphire HD7970 OC with Boost, 1150 MHz/1550... 2x4GB DDR3 1600 Corsair Vengeance 
Hard DriveHard DriveHard DriveOptical Drive
Samsung 840 Pro Samsung 750GB HD753LJ Samsung F3 ASUS 24X DVD Combo Drive 
CoolingOSMonitorKeyboard
Noctua DH14 Windows 8 Professional x64 Crossover 27Q 27" IPS LED, 2560x1440 Logitech G11 
PowerCaseMouseMouse Pad
Corsair TX750 Cooler Master HAF932 Logitech G500 Custom 
AudioAudioAudioAudio
Creative X-Fi Titanium Fatal1ty 2x Dayton B652 Bookshelf Dayton DTA-100A Amplifier Dayton 12" SUB-1200 Subwoofer 
  hide details  
Reply
post #8 of 9
Quote:
Originally Posted by Stealth Pyros View Post
No. Defecation is the process of removing waste from the bowels. Even doing so surgically by means of ostomy is considered defecation.
you sure know your ****
Kinda meh now...
(13 items)
 
  
CPUMotherboardGraphicsRAM
PhII 940 BE asus M4N82 Deluxe 2x 8800gts(g92) 2x 1g ocz ddr2 1066 
Hard DriveOptical DriveOSMonitor
/dev/sd[abc] /dev/sr0 WinXP/Linux 22in acer 
PowerCaseMouseMouse Pad
950w rosewill timebomb Antec 900 (2small) Voodoo Deathadder (RED!) X-Trac Pads Ripper XL 
  hide details  
Reply
Kinda meh now...
(13 items)
 
  
CPUMotherboardGraphicsRAM
PhII 940 BE asus M4N82 Deluxe 2x 8800gts(g92) 2x 1g ocz ddr2 1066 
Hard DriveOptical DriveOSMonitor
/dev/sd[abc] /dev/sr0 WinXP/Linux 22in acer 
PowerCaseMouseMouse Pad
950w rosewill timebomb Antec 900 (2small) Voodoo Deathadder (RED!) X-Trac Pads Ripper XL 
  hide details  
Reply
post #9 of 9
Quote:
Originally Posted by EntTheGod View Post
you sure know your ****
LOL.
Gaming Rig
(20 items)
 
  
CPUMotherboardGraphicsRAM
Intel 2500k, 4.6GHz, 1.304v ASRock P67 Extreme4 Gen3 2x Sapphire HD7970 OC with Boost, 1150 MHz/1550... 2x4GB DDR3 1600 Corsair Vengeance 
Hard DriveHard DriveHard DriveOptical Drive
Samsung 840 Pro Samsung 750GB HD753LJ Samsung F3 ASUS 24X DVD Combo Drive 
CoolingOSMonitorKeyboard
Noctua DH14 Windows 8 Professional x64 Crossover 27Q 27" IPS LED, 2560x1440 Logitech G11 
PowerCaseMouseMouse Pad
Corsair TX750 Cooler Master HAF932 Logitech G500 Custom 
AudioAudioAudioAudio
Creative X-Fi Titanium Fatal1ty 2x Dayton B652 Bookshelf Dayton DTA-100A Amplifier Dayton 12" SUB-1200 Subwoofer 
  hide details  
Reply
Gaming Rig
(20 items)
 
  
CPUMotherboardGraphicsRAM
Intel 2500k, 4.6GHz, 1.304v ASRock P67 Extreme4 Gen3 2x Sapphire HD7970 OC with Boost, 1150 MHz/1550... 2x4GB DDR3 1600 Corsair Vengeance 
Hard DriveHard DriveHard DriveOptical Drive
Samsung 840 Pro Samsung 750GB HD753LJ Samsung F3 ASUS 24X DVD Combo Drive 
CoolingOSMonitorKeyboard
Noctua DH14 Windows 8 Professional x64 Crossover 27Q 27" IPS LED, 2560x1440 Logitech G11 
PowerCaseMouseMouse Pad
Corsair TX750 Cooler Master HAF932 Logitech G500 Custom 
AudioAudioAudioAudio
Creative X-Fi Titanium Fatal1ty 2x Dayton B652 Bookshelf Dayton DTA-100A Amplifier Dayton 12" SUB-1200 Subwoofer 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Issues with user accounts and logging in.