Account Management: Difference between revisions
No edit summary |
No edit summary |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
As you know Telem-GW6 is Busybox Linux based system. So normal commands for managing user accounts and file permissions apply. Typical commands to know and use are: adduser, deluser, passwd, chmod, chown, cp, rm. Introduction to Busybox and its commands can be found from [http://linux.die.net/man/1/busybox] | As you know Telem-GW6 is Busybox Linux based system. So normal commands for managing user accounts and file permissions apply. Typical commands to know and use are: adduser, deluser, passwd, chmod, chown, cp, rm. Introduction to Busybox and its commands can be found from [http://linux.die.net/man/1/busybox] | ||
Small example script that deletes default accounts and adds new account called admin | Small example script that deletes default accounts and adds new account called admin: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
#!/bin/sh | |||
echo "Remove user ftpuser and it's home directory" | echo "Remove user ftpuser and it's home directory" | ||
Line 14: | Line 16: | ||
echo "Create user admin" | echo "Create user admin" | ||
adduser admin | adduser admin | ||
</syntaxhighlight> | |||
It needs to be executed as root user. If this script was saved as config_accounts.sh and saved from host PC to /home/ftpuser. Then in order to execute it at GW6 you need to become an root user by executing: | |||
<syntaxhighlight lang="bash"> | |||
su - | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Then change execution rights and save it to folder /root from /home/ftpuser(because script deletes ftpuser's home directory): | |||
<syntaxhighlight lang="bash"> | |||
cp config_accounts.sh /root/config_accounts.sh | |||
cd /root | |||
chmod +x config_accounts.sh | |||
./config_accounts.sh | |||
</syntaxhighlight> | |||
Last line executes script config_accounts.sh wich creats new account admin and deletes default accounts martem and ftpuser. | |||
As of new gws.exe it is possible to manage accounts from "SSH Settings" tab. Small howto can be found from here [[Basic Security]]. |
Latest revision as of 08:25, 6 June 2013
As you know Telem-GW6 is Busybox Linux based system. So normal commands for managing user accounts and file permissions apply. Typical commands to know and use are: adduser, deluser, passwd, chmod, chown, cp, rm. Introduction to Busybox and its commands can be found from [1]
Small example script that deletes default accounts and adds new account called admin:
#!/bin/sh
echo "Remove user ftpuser and it's home directory"
deluser ftpuser
rm -r /home/ftpuser
echo "Remove user martem and it's home directory"
deluser martem
rm -r /home/martem
echo "Create user admin"
adduser admin
It needs to be executed as root user. If this script was saved as config_accounts.sh and saved from host PC to /home/ftpuser. Then in order to execute it at GW6 you need to become an root user by executing:
su -
Then change execution rights and save it to folder /root from /home/ftpuser(because script deletes ftpuser's home directory):
cp config_accounts.sh /root/config_accounts.sh
cd /root
chmod +x config_accounts.sh
./config_accounts.sh
Last line executes script config_accounts.sh wich creats new account admin and deletes default accounts martem and ftpuser.
As of new gws.exe it is possible to manage accounts from "SSH Settings" tab. Small howto can be found from here Basic Security.