The correct way to login as root is to type:
su -
This works on systems where sudo is inavailable or not configured.
Some distributions disallow logging in as root and then one should run his commands like this:
sudo MyCommandHere...
Short answer:
You command was incorrect:
useradd -d /path/to/home -s /path/to/shell -g admin username
Use
useradd -d /home/username -s /bin/sh -g admin username
to create normal user.
Tady posted some info in the chat:
tady:$:15750:0:99999:7:::
squarepeg:$:15751:0:99999:7:::
that's the /etc/shadow
and the /etc/passwd
tady:x:5001:5001::/var/www:/bin/false
squarepeg:x:5003:109:square peg design:/var/www:/bin/false
The /bin/false home directory exists, I created it so users had somewhere to go even
though they never use it (though looking at it, it's owner and group are root:root.
would this matter?)
The /var/www shell is where I want them to go when they login
"The format of the passwd file is pretty standard."
Yes, it is true. And format is informally described here: Wikipedia:Passwd (file); or, more normative, man 5 passwd
(from ubuntu)
Check an example:
jsmith:.......:/home/jsmith:/bin/sh
Wiki decodes it as:
The sixth field is the path to the user's home directory.
The seventh field is the program that is started every time the user logs into the system. ... this is usually one of the system's command line interpreters (shells).
So, jmsith has home directory /home/jsmith
and shell program /bin/sh
which is legal shell (all legal shells are listed in the file /etc/shells
). Check man shells
, it says:
/etc/shells is a text file which contains the full pathnames of valid login shells...
Be aware that there are programs which consult this file to find out if a user is a normal user. E.g.: ftp daemons traditionally disallow access to users with shells not included in this file.
In my Linux /bin/false
is not listed here as valid shell.
According to citation of your passwd, tady and squarepeg have the home dir /var/www
and /bin/false
is their shell program. When they login in, shell is started; after shell termination, session is closed. /bin/false
is simple unix program which ... exits in short time (check Wikipedia:False (Unix) or just think about it as main(){return 1;}
).
Normal shell is the interactive program which reads user input and executes it in endless loop. Shell is started when you does ssh
to the computer. And you can't use ftp for users who has /bin/false
shell.
PS: If you want to prohibit somebody of using ssh, but allow them to use vsftpd, there are hacks
Best Answer
Your Synology probably upgraded to DSM6, in which security has been hardened... In DSM6 you can no longer use root for SSH, but you can use any other member account of the administrators group. Mind that you now need to sudo when logged in using SSH.
See the DSM6 release notes!