FreeBSD 中 SSH 的 su 不能登入和設置


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#SSH 進入 FreeBSD 後切換到用戶 (su username) 時發生了
This account is currently not available.

# 解決方法是使用
chpass [username]

# 之後直接修改 shell 的那一行,指向到需要的 shell language
# 如:
Shell: /bin/csh

# 之後存檔,再 su 就應該可以了

#####
注:
別直接修改 /etc/passwd 和 /etc/master.passwd
否則會出現

chpass: entry inconsistent
chpass: pw_copy: Invalid argument

#####
另外要將 /usr/sbin/nologin 當為可用 shell
可以直接將其加入到 /etc/shells
此舉可以配和 proftpd.conf 作為只可以登入 ftp 而不可以登陸 ssh

#####
另外要指定可使用 ssh 中誰不可以進入,改 Port 可以參考這篇
http://linux.vbird.org/linux_server/0310telnetssh.php#ssh_sshdconfig