亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 3882 | 回復(fù): 6
打印 上一主題 下一主題

[系統(tǒng)管理] 為何.bashrc中加上echo,sftp就壞了? [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2010-11-25 00:08 |只看該作者 |倒序瀏覽
本帖最后由 aleng 于 2010-11-25 14:51 編輯

我是可以用root,通過ssh,sftp連接到我的服務(wù)器的,但是呢,最近sftp連不上了,但是ssh還是好的。

經(jīng)過我的排查,我發(fā)現(xiàn),不能在。bashrc中加如任何echo 語句,去掉echo語句立馬就好,

服務(wù)器是centos和fc,用了2種sftp客戶端軟件都是這樣。這兩種客戶端軟件都不是putty開發(fā)的。

真是奇了 ,誰幫我試試,你那是不是這樣。

論壇徽章:
0
2 [報告]
發(fā)表于 2010-11-25 10:44 |只看該作者
見putty的FAQ
A.7.6 When attempting a file transfer, either PSCP or PSFTP says ‘Out of memory’ and dies.

This is almost always caused by your login scripts on the server generating output. PSCP or PSFTP will receive that output when they were expecting to see the start of a file transfer protocol, and they will attempt to interpret the output as file-transfer protocol. This will usually lead to an ‘out of memory’ error for much the same reasons as given in question A.7.5.

This is a setup problem in your account on your server, not a PSCP/PSFTP bug. Your login scripts should never generate output during non-interactive sessions; secure file transfer is not the only form of remote access that will break if they do.

On Unix, a simple fix is to ensure that all the parts of your login script that might generate output are in .profile (if you use a Bourne shell derivative) or .login (if you use a C shell). Putting them in more general files such as .bashrc or .cshrc is liable to lead to problems.

http://www.chiark.greenend.org.uk/~sgtatham/putty/faq.html

論壇徽章:
0
3 [報告]
發(fā)表于 2012-08-17 16:41 |只看該作者
今天我也遇到差不多的情況了。
我在bashrc中加入了一個df -h用來每次登錄看硬盤大小(個人需要,因為硬盤是作數(shù)據(jù)交互的,但用處不大,就這么湊合了),結(jié)果用FILEZILLA登錄SFTP,提示out of memory。
后來改在在crontab中把df -h寫到/tmp/df_h中,在bashrc中用cat來顯示也不行。
最后想起昨天搞screen時提示的:Cannot open your terminal '/dev/pts/1' - please check,這個錯誤讓我想到了SFTP登錄和普通登錄的區(qū)別,然后把bashrc中的改成下面這樣:
if [ ! '' = `tty |grep dev` ]; then df -h; fi
是很無語的作法,BUT IT WORKS WELL!

論壇徽章:
1
2015年辭舊歲徽章
日期:2015-03-03 16:54:15
4 [報告]
發(fā)表于 2012-08-17 17:23 |只看該作者
你會發(fā)現(xiàn),如果用rsync傳文件的話也會報錯的,所以不能在bash_profile和bashrc里面增加echo之類的命令,你要是想加點內(nèi)容,可以往/etc/motd里面加

論壇徽章:
15
2015年辭舊歲徽章
日期:2015-03-03 16:54:15雙魚座
日期:2015-01-15 17:29:44午馬
日期:2015-01-06 17:06:51子鼠
日期:2014-11-24 10:11:13寅虎
日期:2014-08-18 07:10:55酉雞
日期:2014-04-02 12:24:51雙子座
日期:2014-04-02 12:19:44天秤座
日期:2014-03-17 11:43:36亥豬
日期:2014-03-13 08:13:51未羊
日期:2014-03-11 12:42:03白羊座
日期:2013-11-20 10:15:18CU大;照
日期:2013-04-17 11:48:45
5 [報告]
發(fā)表于 2012-08-20 09:25 |只看該作者
zhsh87 發(fā)表于 2012-08-17 19:23
你會發(fā)現(xiàn),如果用rsync傳文件的話也會報錯的,所以不能在bash_profile和bashrc里面增加echo之類的命令,你要 ...

/etc/motd 是個全局的設(shè)置。

lkk2003rty 的回復(fù)中,已經(jīng)提到了,針對個人的設(shè)置,可以加在 .profile 或者 .login 里。

論壇徽章:
1
2015年辭舊歲徽章
日期:2015-03-03 16:54:15
6 [報告]
發(fā)表于 2012-08-20 09:58 |只看該作者
.profile最好別加echo,可能還會引起傳文件報錯的問題,.login到?jīng)]試過,有興趣可以試試

論壇徽章:
0
7 [報告]
發(fā)表于 2012-08-20 13:55 |只看該作者
把echo寫入一個shell腳本,在.profile調(diào)用這個腳本試試。
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP