wiki.ipfire.org

The community-maintained documentation platform of IPFire

User Tools

Site Tools


optimization:system:user:start

Add a System-User

Maybe some of you want to add a system-user, for irssi, centerim, or won't allow root login on ssh.

With this command we'll add the user homersimpson with the password springfield.
The Option -d defined the homefolder and -m creat it. -u set the UID (take care if you'll add more than one user). -g add the user to group users and -s setup the default bash.

# useradd -g users -u 1001 -d /home/homersimpson -s /bin/bash -m -p springfield homersimpson  

Now you should login as homersimpson. If login failed, set the password for homersimpson again.

# passwd homersimpson

Before we finished, we have to get a .bashrc and have to add an alias for su.

$ cp /etc/bashrc ~/.bashrc

Just open ~/.bashrc with your favorite editor and add this line.

alias su='su -l' 

Finally reload you ~/.bashrc like that.

$ source ~/.bashrc

sshd

WARNING: Take care! Just do it if login as user works or you have physical access to the hardware!

To forbid root login via ssh, edit in /etc/ssh/sshd_config this line like that.

PermitRootLogin no

If you can't login as homersimpson, add this lines to you sshd_config.

UserPAM yes
AllowUsers homersimpson

Finally restart your sshd.

# /etc/init.d/sshd restart
optimization/system/user/start.txt · Last modified: 2015/10/21 14:33 by twilson