Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how can i edit via telnet? (me real noob)
#1

i only have access via telnet, how could i edit a text file?

i tried the ed command but i dont know how that works, i just get a number and then question-marks, i dont even know how to exit edlin.

 

thank you.

(what i am trying to do is, to edit the php.ini)

Reply
#2
to use your text editor telnet into the box with the file you wanna edit then type cd over to the directory the file is in and type vi filenamegoeshere . once it brings up your file type i this will allow you to edit the file then when your done editing hit esc and type :wq
Reply
#3

ur answer sounds very confusing to me, but this is what i did:

 

i copied it to a folder which i can access with my ftp.

i edited it and uploaded it again

now back in telnet, im trying to copy it where i got it from

 

these i belive are the paths:

 

/etc/php.ini <- this is where i want to copy the edited one

/home/pblach/php.ini <- this is my edited version in my folder.

 

im using this command but for some reason it doesnt work:

(beeing in the etc directory)

 

cp /home/pblach/php.ini /

cp /home/pblach/php.ini .

 

i tried both commands and they dont work, do i have a wrong syntax?

it says:

cp: cannot create reular file '/php.ini': Permission denied

 

 

thx

Reply
#4

these i belive are the paths:

 

/etc/php.ini <- this is where i want to copy the edited one

/home/pblach/php.ini <- this is my edited version in my folder.

 

im using this command but for some reason it doesnt work:

(beeing in the etc directory)

 

cp /home/pblach/php.ini /

cp /home/pblach/php.ini .

 

i tried both commands and they dont work, do i have a wrong syntax?

it says:

cp: cannot create reular file '/php.ini': Permission denied

------------------------------------------------------------------------------------

if you want the file /home/pblach/php.ini to overwrite /etc/php.ini type

cp /home/pblach/php.ini /etc/php.ini

i beleive by doin cp /home/pblach/php.ini / you were trying to write it straight to the root directory which is why you were getting permission errors, which would be good cuz you didnt want it there anyway.

Reply
#5

you are getting permission denied because you are not root

 

to login as root type this

 

su -

 

note the - after su

 

also, do NOT use telnet. it is totally insecure, use ssh instead

 

cheers

 

anyweb

Reply
#6
you shold not be using telnet. try OpenSSH.
Reply
#7

Tek-69 is right. Your not quite telling it to do what you want. The syntax for cp goes like this:

 

cp <source> <destination>

 

so you want to type :

 

cp /home/pblach/php.ini /etc

 

And like the other guys said, you really don't want to use telnet, ssh is the way to go. If you're using windows, try using PuTTY.

 

[/url]http://www.chiark.greenend.org.uk/~sgtatham/putty/

 

Also, your original question about wasn't really answered. vi is a standard editor in linux. If you type vi <filename> it will open the file to be edited. Using vi is not extremely intuitive so you might want to check out a small tutorial on how to use it. Here is one I just googled:

 

[url=http://www.bo.infn.it/alice/alice-doc/mll-...i-ex/node2.html]http://www.bo.infn.it/alice/alice-doc/mll-...i-ex/node2.html

 

Good luck.

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)