- sudo su -
- cd /usr/sbin
- ./adduser 新增的帳號 EX:./adduser testacc
- 給新增的帳號密碼 passwd 帳號 EX:passwd testacc
- 開啟visudo ./visudo
- 按下i進入編輯
- 在 ## Allow root to run any commands anywhere
root ALL=(ALL) ALL
後加入 testacc ALL=(ALL) ALL - 按下:wq!存檔
FreeBsd:
1.打adduser
# adduser
Username: testname
Full name: testname
Uid (Leave empty for default):
Login group [testname]:
Login group is testname. Invite testname into other groups? []:
Login class [default]:
Shell (sh csh tcsh nologin) [sh]:
Home directory [/home/testname]:
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]: yes
Use an empty password? (yes/no) [no]: no
Use a random password? (yes/no) [no]: no
Enter password:
Enter password again:
Lock out the account after creation? [no]:
Username : testname
Password : *****
Full Name : testname
Uid : 1008
Class :
Groups : testname
Home : /home/testname
Home Mode :
Shell : /bin/sh
Locked : no
OK? (yes/no): yes
adduser: INFO: Successfully added (testname) to the user database.
Add another user? (yes/no): no
Goodbye!
2.編輯sudoers
vi /usr/local/etc/sudoers
在# User privilege specification
root ALL=(ALL) ALL
後加入
testname ALL=(ALL) ALL
freebsd 安裝sudo
ssh> cd /usr/ports/security/sudo
ssh> make install clean
進入後有個畫面,直接按TAB,然後OK
ssh> rehash
沒有留言:
張貼留言